﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;
using gfLibrary;
using System.Drawing;
using System.Data;
using IYAKASAPortal.Services;
using System.Xml.Linq;
using System.IO;
using System.Xml;
using DBUtility;
using System.Configuration;

namespace IYAKASAPortal.Login
{
    public partial class LoginZJ : System.Web.UI.Page
    {
        private static List<ListItem> lstItems { get; set; }
        private static List<ListItem> lstItemsGC { get; set; }
        private UserInfo userInfo { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] != null && Session["UserName"].ToString() != "")
            {
                string userName = Session["UserName"].ToString();
                userInfo = IYAKASAPortal.Services.UserAuthority.GetUserAuthority(userName);
            }
            else
            {
                gfJs.RunFunction(this.Page, "parent.window.location = '../logout.aspx';");
            }

            if (!IsPostBack)
            {
                CONST_DEFINE_WEB_BLL bll = new CONST_DEFINE_WEB_BLL();
                var Info = bll.GetModelList("CategoryID=13 and Name='YHYDXZ'");

                if (Info.Length > 0)
                {
                    if (Info[0].ValueOfName == "1")
                    {
                        divYHYD.Visible = true;
                    }
                    else
                    {
                        divYHYD.Visible = false;
                    }
                }

                BindData();
            }
        }

        private void BindData()
        {
            lstItems = new List<ListItem>();
            lstItemsGC = new List<ListItem>();
            CONST_DEFINE_BLL bll = new CONST_DEFINE_BLL();
            var def = bll.GetModelList("CON_CHNAME='JYLB' and CON_VTYPE='0' order by CON_ORDER asc");

            ListItem item;
            foreach (var v in def)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpJYLB.Items.Add(item);
                drpJYLBGC.Items.Add(item);
            }

            drpJYLB.SelectedValue = "12";
            drpJYLBGC.SelectedValue = "12";

            var hpzl = bll.GetModelList("CON_CHNAME='HPZL' and CON_CODE<>15  order by CON_ORDER asc");
            foreach (var v in hpzl)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpHPZL.Items.Add(item);
            }
            drpHPZLGC.Items.Add(new ListItem() { Text = "挂车", Value = "15" });

            var clzl = bll.GetModelList("CON_CHNAME='CLZL' and SUBSTRING(CON_CODE,1,1)<>'G'  order by CON_ORDER asc");
            foreach (var v in clzl)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpCLZL.Items.Add(item);
            }

            var clzlGC = bll.GetModelList("CON_CHNAME='CLZL' and (SUBSTRING(CON_CODE,1,1)='B' or SUBSTRING(CON_CODE,1,1)='G')  order by CON_ORDER asc");
            foreach (var v in clzlGC)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpCLZLGC.Items.Add(item);
            }

            var syxz = bll.GetModelList("CON_CHNAME='SYXZ' order by CON_ORDER asc");
            foreach (var v in syxz)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpSYXZ.Items.Add(item);
                drpSYXZGC.Items.Add(item);
            }

            var zxzxjxs = bll.GetModelList("CON_CHNAME='ZXZXJXS' order by CON_ORDER asc");
            foreach (var v in zxzxjxs)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpZXZXJXS.Items.Add(item);
            }

            var zxzlx = bll.GetModelList("CON_CHNAME='ZXZLX' order by CON_ORDER asc");
            foreach (var v in zxzlx)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpZXZLX.Items.Add(item);
            }

            var csys = bll.GetModelList("CON_CHNAME='CSYS' order by CON_ORDER asc");
            foreach (var v in csys)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpCSYS.Items.Add(item);
                drpCSYSGC.Items.Add(item);
            }

            var qzdz = bll.GetModelList("CON_CHNAME='QZDZ' order by CON_ORDER asc");
            foreach (var v in qzdz)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpQZDZ.Items.Add(item);
            }

            var yggsnfkt = bll.GetModelList("CON_CHNAME='YGGSNFKT' order by CON_ORDER asc");
            foreach (var v in yggsnfkt)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpYGGSNFKT.Items.Add(item);
            }

            var rllb = bll.GetModelList("CON_CHNAME='RLLB' order by CON_ORDER asc");
            foreach (var v in rllb)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpRLLB.Items.Add(item);
            }
            if (drpRLLB.SelectedValue == "A")
            {
                txtEDNJ.Enabled = false;
                txtEDNJZS.Enabled = false;
                lblStarNJZS.Text = "";
                lblStarNJ.Text = "";
            }
            var lwcxwzjl = bll.GetModelList("CON_CHNAME='LWCXWZJL' order by CON_ORDER asc");
            foreach (var v in lwcxwzjl)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpLWCXWZJL.Items.Add(item);
                drpLWCXWZJLGC.Items.Add(item);
            }

            var ltgglx = bll.GetModelList("CON_CHNAME='LTGGLX' order by CON_ORDER asc");
            foreach (var v in ltgglx)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpLTGGLX.Items.Add(item);
            }

            var kclxdj = bll.GetModelList("CON_CHNAME='KCLXDJ' order by CON_ORDER asc");
            foreach (var v in kclxdj)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpKCLXDJ.Items.Add(item);
            }

            var bzzxs = bll.GetModelList("CON_CHNAME='BZZXS' order by CON_ORDER asc");
            foreach (var v in bzzxs)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpBZZXS.Items.Add(item);
                drpBZZXSGC.Items.Add(item);
            }

            var hccsxs = bll.GetModelList("CON_CHNAME='HCCSXS' order by CON_ORDER asc");
            foreach (var v in hccsxs)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpHCCSXS.Items.Add(item);
                drpHCCSXSGC.Items.Add(item);
            }

            var clcclx = bll.GetModelList("CON_CHNAME='CLCCLX' order by CON_ORDER asc");
            foreach (var v in clcclx)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpCLCCLX.Items.Add(item);
                drpCLCCLXGC.Items.Add(item);
            }

            var zjcllx = bll.GetModelList("CON_CHNAME='ZJCLLX' order by CON_ORDER asc");
            foreach (var v in zjcllx)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpZJCLLX.Items.Add(item);
                drpZJCLLXGC.Items.Add(item);
            }

            var sfswpc = bll.GetModelList("CON_CHNAME='SFSWPC' order by CON_ORDER asc");
            foreach (var v in sfswpc)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpSFSWPC.Items.Add(item);
            }

            var ycy = bll.GetModelList("CON_CHNAME='YWLX' order by CON_ORDER asc");
            foreach (var v in ycy)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CON;
                drpYWLX.Items.Add(item);
            }

            var jyxm = bll.GetModelList("CON_CHNAME='JYXM' and CON_JCTYPE like '%03,%' order by CON_ORDER asc");
            foreach (var v in jyxm)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                lstItems.Add(item);
            }

            var jyxmGC = bll.GetModelList("CON_CHNAME='JYXM' and CON_JCTYPE like '%04,%' order by CON_ORDER asc");
            foreach (var v in jyxmGC)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                lstItemsGC.Add(item);
            }
            //绑定模板
            CONST_DEFINE_WEB_BLL cdw_bll = new CONST_DEFINE_WEB_BLL();
            var jyxmmb = cdw_bll.GetModelList("CategoryId='6'");
            foreach (var j in jyxmmb)
            {
                item = new ListItem();
                item.Text = j.Name;
                item.Value = j.ValueOfName;
                rblSelectItems.Items.Add(item);
            }
            //绑定挂车模板
            var jyxmgcmb = cdw_bll.GetModelList("CategoryId='7'");
            foreach (var j in jyxmgcmb)
            {
                item = new ListItem();
                item.Text = j.Name;
                item.Value = j.ValueOfName;
                rblCheckItemGC.Items.Add(item);
            }
            for (int i = 2; i < 7; i++)
            {
                item = new ListItem();
                item.Text = i.ToString() + "";
                item.Value = i.ToString();
                drpZZS.Items.Add(item);
                drpZZSGC.Items.Add(item);
            }

            var qdxs = bll.GetModelList("CON_CHNAME='QDXS' order by CON_ORDER asc");
            foreach (var v in qdxs)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpQDXS.Items.Add(item);
            }

            //绑定号码开头
            CONST_DEFINE_WEB_CATEGORY_BLL category_bll = new CONST_DEFINE_WEB_CATEGORY_BLL();
            var hphmStart = category_bll.GetModel(8);
            txtHPHMStart.Text = hphmStart.CategoryName;
            txtHPHMStartGC.Text = hphmStart.CategoryName;

            var keyValue = category_bll.GetModel(9);
            hidKeyValue.Value = keyValue.CategoryName;

            LoginHelper.BindZCZWZ(Convert.ToInt32(drpZZS.SelectedValue), chkZCZWZ, chkQDZWZ);
            drpZZS_SelectedIndexChanged(null, null);

            drpRLLB_SelectedIndexChanged(null, null);

            //绑定挂车驻车轴位置
            LoginHelper.BindZCZWZ(Convert.ToInt32(drpZZSGC.SelectedValue), chkZCZWZGC);

            ReBindJCXM();

            int iZZS = Convert.ToInt32(drpZZSGC.SelectedValue);
            LoginHelper.BindJCXMGC_ZJ( iZZS, chkJYXMGC, lstItemsGC);
        }

        protected void chkAll_CheckedChanged(object sender, EventArgs e)
        {
            LoginHelper.CheckAll(chkJYXM, chkAll.Checked);
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            //综检检验登录
            string strJYLB = drpJYLB.SelectedValue.Trim() + ",";
            string strHPHM = txtHPHMStart.Text.Trim().ToUpper() + txtHPHM.Text.Trim().ToUpper();
            string strHPHM_H = txtHPHMStart.Text.Trim().ToUpper();
            string strHPHM_C = txtHPHM.Text.Trim().ToUpper();
            string strHPZL = drpHPZL.SelectedValue.Trim();
            string strVIN = txtVIN.Text.Trim().ToUpper();
            string strSYR = txtSYR.Text.Trim();
            string strAddress = txtAddress.Text.Trim();
            string strPP = txtPP.Text.Trim();
            string strXH = txtXH.Text.Trim().ToUpper();
            string strFDJXH = txtFDJXH.Text.Trim().ToUpper();
            string strFDJHM = txtFDJNumber.Text.Trim().ToUpper();
            string strCCRQ = txtCCRQ.Text.Trim();
            string strCSDJRQ = txtCSDJRQ.Text.Trim();
            string strHZRS = txtHZRS.Text.Trim();
            string strZZL = txtZZL.Text.Trim();
            string strZBZL = txtZBZL.Text.Trim();
            string strHDZZL = txtHDZZL.Text.Trim();
            string strWKCCC = txtWKCCC.Text.Trim();
            string strWKCCK = txtWKCCK.Text.Trim();
            string strWKCCG = txtWKCCG.Text.Trim();
            string strQDZWZ = "";
            string strZCZWZ = "";
            string strZGSJCS = txtZGSJCS.Text.Trim();
            string strEDGL = txtEDGL.Text.Trim();
            string strEDNJ = txtEDNJ.Text.Trim();
            string strEDNJZS = txtEDNJZS.Text.Trim();
            string strYZLJ = txtYZLJ.Text.Trim();
            string strQDZKZZL = txtQDZKZZL.Text.Trim();
            string strHDZH = txtHDZH.Text.Trim();
            string strLJXSLC = txtLJXSLC.Text.Trim();
            string strYYZH = txtYYZH.Text.Trim();
            string strXZQY = txtXZQY.Text.Trim();
            string strJYXM = "";

            string strYHXZ = txtYHXZ.Text.Trim();
            string strYHSD = txtYHSD.Text.Trim();
            string strYDXZ = txtYDXZ.Text.Trim();
            string strPL = txtPL.Text.Trim();
            string strEDZS = txtEDZS.Text.Trim();

            bool bChecked = CheckAllTextBox();
            if (!bChecked)
            {
                return;
            }

            for (int i = 0; i < chkZCZWZ.Items.Count; i++)
            {
                if (chkZCZWZ.Items[i].Selected)
                {
                    strZCZWZ += chkZCZWZ.Items[i].Value + ",";
                }
            }

            for (int i = 0; i < chkQDZWZ.Items.Count; i++)
            {
                if (chkQDZWZ.Items[i].Selected)
                {
                    strQDZWZ += chkQDZWZ.Items[i].Value + ",";
                }
            }

            for (int i = 0; i < chkJYXM.Items.Count; i++)
            {
                if (chkJYXM.Items[i].Selected)
                {
                    strJYXM += chkJYXM.Items[i].Value + ",";
                }
            }

            string strSFSQCLC = chkQCLC.Checked ? "1" : "0";
            string strVEHICLEID = strHPZL + strHPHM;

            LOGIN_VEHICLE_INFO info = new LOGIN_VEHICLE_INFO();
            info.VEHICLEID = strVEHICLEID;
            info.HPHM = strHPHM;
            info.HPZL = drpHPZL.SelectedItem.Text;
            info.HPZLDH = strHPZL;
            info.VIN = strVIN;
            info.JYLB = drpJYLB.SelectedItem.Text;
            info.JYLBDH = strJYLB;
            info.CLZL = drpCLZL.SelectedItem.Text;
            info.CLZLDH = drpCLZL.SelectedItem.Value;
            info.FDJH = strFDJHM;
            info.FDJXH = strFDJXH;
            info.PP = strPP;
            info.XH = strXH;
            info.PPXH = strPP + strXH;
            info.QDZWZ = strQDZWZ;
            info.ZCZWZ = strZCZWZ;
            info.QZDZ = drpQZDZ.SelectedItem.Text;
            info.QZDZDH = drpQZDZ.SelectedItem.Value;
            info.YGGSNFKT = drpYGGSNFKT.SelectedItem.Text;
            info.YGGSNFKTDH = drpYGGSNFKT.SelectedItem.Value;
            info.RLLB = drpRLLB.SelectedItem.Text;
            info.RLLBDH = drpRLLB.SelectedItem.Value;
            info.CCDJRQ = strCSDJRQ;
            info.CCRQ = strCSDJRQ;
            info.CSYS = drpCSYS.SelectedItem.Text;
            info.CSYSDH = drpCSYS.SelectedValue;
            info.ZBZL = strZBZL;
            info.ZZL = strZZL;
            info.CYS = strHZRS;
            info.ZXZXJXS = drpZXZXJXS.SelectedItem.Text;
            info.ZXZXJXSDH = drpZXZXJXS.SelectedItem.Value;
            info.ZXZLX = drpZXZLX.SelectedItem.Text;
            info.ZXZLXDH = drpZXZLX.SelectedItem.Value;
            info.ZGSJCS = strZGSJCS;
            info.SYR = strSYR;
            info.LXDZ = strAddress;
            info.SYXZ = drpSYXZ.SelectedItem.Text;
            info.SYXZDH = drpSYXZ.SelectedItem.Value;
            info.HDZH = strHDZZL;
            info.JYXM_LW = strJYXM;
            info.JYXM = strJYXM;
            info.CSC = strWKCCC;
            info.CSK = strWKCCK;
            info.CSG = strWKCCG;
            info.DLY = userInfo.UserName;
            info.QDZWZ = strQDZWZ;
            info.LWCXWZJLDH = drpLWCXWZJL.SelectedItem.Value;
            info.LWCXWZJL = drpLWCXWZJL.SelectedItem.Text;
            info.ZZS = drpZZS.SelectedItem.Value;
            info.QDXS = drpQDXS.SelectedItem.Text;
            info.QDXSDH = drpQDXS.SelectedItem.Value;
            info.ZJLSH = txtZJLSH.Text.Trim();
            info.SFSQCLC = strSFSQCLC;

            //综检
            info.FDJPL = strPL;
            info.EDZS = strEDZS;
            info.CCRQ = strCCRQ;
            info.EDGL = strEDGL;
            info.EDNJ = strEDNJ;
            info.EDNJZS = strEDNJZS;
            info.LTGGLX = drpLTGGLX.SelectedItem.Text;
            info.LTGGLXDH = drpLTGGLX.SelectedItem.Value;
            info.KCLXDJ = drpKCLXDJ.SelectedItem.Text;
            info.YZLJ = strYZLJ;
            info.QDZKZZL = strQDZKZZL;
            info.QYCMZZZL = strHDZH;
            info.LJXSLC = strLJXSLC;
            info.YYZH = strYYZH;
            info.XZQY = strXZQY;
            info.BZZXS = drpBZZXS.SelectedItem.Text;
            info.BZZXSDH = drpBZZXS.SelectedItem.Value;
            info.HCCSXS = drpHCCSXS.SelectedItem.Text;
            info.CLCCLX = drpCLCCLX.SelectedItem.Text;
            info.CLCCLXDH = drpCLCCLX.SelectedItem.Value;
            info.ZJCLLX = drpZJCLLX.SelectedItem.Text;
            info.ZJCLLXDH = drpZJCLLX.SelectedItem.Value;
            info.SFSWPC = drpSFSWPC.SelectedItem.Text;
            info.YWLX = drpYWLX.SelectedItem.Text;
            if (divYHYD.Visible)
            {
                info.YDXZ = strYDXZ;
                info.YHSD = strYHSD;
                info.YHXZ = strYHXZ;
            }
            
            LOGIN_VEHICLE_INFO_BLL bll = new LOGIN_VEHICLE_INFO_BLL();

            if (string.IsNullOrEmpty(userInfo.UserName))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "当前没有授权,请退出系统重新登录！");
                return;
            }

            bool bOnGoing = LoginHelper.GetVehicleStatus(strVEHICLEID);
            if (bOnGoing)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车辆【" + strVEHICLEID + "】正在检测，不能保存当前信息！");
                return;
            }

            var vInfo = LoginHelper.GetLoginInfo(strHPHM, strHPZL);

            if (vInfo == null)
            {
                if (bll.Insert(info) == true)
                {
                    hidID.Value = LoginHelper.GetLoginInfo(strHPHM, strHPZL).ID.ToString();
                    LoginHelper.SavePPXHAndFDJXH(info);
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "】保存成功！");
                    btnSend.Enabled = true;
                    btnSend.CssClass = "btnSendEnabled";
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "】保存失败！");
                    return;
                }
            }
            else
            {
                if (bll.Update(info, vInfo.ID) == true)
                {
                    hidID.Value = vInfo.ID.ToString();
                    LoginHelper.SavePPXHAndFDJXH(info);
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "】更新成功！");
                    btnSend.Enabled = true;
                    btnSend.CssClass = "btnSendEnabled";
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "】更新失败！");
                    return;
                }
            }
        }

        private void ResetAll()
        {
            List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
            List<Control> lstControls = new List<Control>();

            lstCtl.Add(new LoginHelper.ControlNames(drpJYLB.ID, "12"));
            lstControls.Add(drpJYLB);

            lstCtl.Add(new LoginHelper.ControlNames(drpHPZL.ID, ""));
            lstControls.Add(drpHPZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLZL.ID, ""));
            lstControls.Add(drpCLZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpLWCXWZJL.ID, ""));
            lstControls.Add(drpLWCXWZJL);

            lstCtl.Add(new LoginHelper.ControlNames(chkQDZWZ.ID, "2,"));
            lstControls.Add(chkQDZWZ);

            lstCtl.Add(new LoginHelper.ControlNames(drpQZDZ.ID, ""));
            lstControls.Add(drpQZDZ);

            lstCtl.Add(new LoginHelper.ControlNames(drpRLLB.ID, ""));
            lstControls.Add(drpRLLB);

            lstCtl.Add(new LoginHelper.ControlNames(drpSYXZ.ID, ""));
            lstControls.Add(drpSYXZ);

            lstCtl.Add(new LoginHelper.ControlNames(drpYGGSNFKT.ID, ""));
            lstControls.Add(drpYGGSNFKT);

            lstCtl.Add( new LoginHelper.ControlNames(drpZXZLX.ID, ""));
            lstControls.Add(drpZXZLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpZXZXJXS.ID, ""));
            lstControls.Add(drpZXZXJXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpLTGGLX.ID, ""));
            lstControls.Add(drpLTGGLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpKCLXDJ.ID, ""));
            lstControls.Add(drpKCLXDJ);

            lstCtl.Add(new LoginHelper.ControlNames(drpBZZXS.ID, ""));
            lstControls.Add(drpBZZXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLCCLX.ID, ""));
            lstControls.Add(drpCLCCLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpZZS.ID, ""));
            lstControls.Add(drpZZS);

            lstCtl.Add(new LoginHelper.ControlNames(drpQDXS.ID,""));
            lstControls.Add(drpQDXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpZJCLLX.ID, ""));
            lstControls.Add(drpZJCLLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpSFSWPC.ID, ""));
            lstControls.Add(drpSFSWPC);

            lstCtl.Add(new LoginHelper.ControlNames(drpYWLX.ID, ""));
            lstControls.Add(drpYWLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpHCCSXS.ID, ""));
            lstControls.Add(drpHCCSXS);

            lstCtl.Add(new LoginHelper.ControlNames(txtAddress.ID, ""));
            lstControls.Add(txtAddress);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSDJRQ.ID, ""));
            lstControls.Add(txtCSDJRQ);

            lstCtl.Add(new LoginHelper.ControlNames(txtFDJNumber.ID, ""));
            lstControls.Add(txtFDJNumber);

            lstCtl.Add(new LoginHelper.ControlNames(txtHDZZL.ID, ""));
            lstControls.Add(txtHDZZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtPL.ID, ""));
            lstControls.Add(txtPL);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDZS.ID, ""));
            lstControls.Add(txtEDZS);

            lstCtl.Add(new LoginHelper.ControlNames(txtHZRS.ID, ""));
            lstControls.Add(txtHZRS);

            lstCtl.Add(new LoginHelper.ControlNames(drpCSYS.ID, ""));
            lstControls.Add(drpCSYS);

            lstCtl.Add(new LoginHelper.ControlNames(txtHPHM.ID, ""));
            lstControls.Add(txtHPHM);

            lstCtl.Add(new LoginHelper.ControlNames(txtSYR.ID, ""));
            lstControls.Add(txtSYR);

            lstCtl.Add(new LoginHelper.ControlNames(txtPP.ID, ""));
            lstControls.Add(txtPP);

            lstCtl.Add(new LoginHelper.ControlNames(txtVIN.ID, ""));
            lstControls.Add(txtVIN);

            lstCtl.Add(new LoginHelper.ControlNames(txtWKCCC.ID, ""));
            lstControls.Add(txtWKCCC);

            lstCtl.Add(new LoginHelper.ControlNames(txtWKCCK.ID, ""));
            lstControls.Add(txtWKCCK);

            lstCtl.Add(new LoginHelper.ControlNames(txtWKCCG.ID, ""));
            lstControls.Add(txtWKCCG);

            lstCtl.Add(new LoginHelper.ControlNames(txtXH.ID, ""));
            lstControls.Add(txtXH);

            lstCtl.Add( new LoginHelper.ControlNames(txtZBZL.ID, ""));
            lstControls.Add(txtZBZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtZGSJCS.ID, ""));
            lstControls.Add(txtZGSJCS);

            lstCtl.Add(new LoginHelper.ControlNames(txtZZL.ID, ""));
            lstControls.Add(txtZZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtCCRQ.ID, DateTime.Now.AddYears(-5).ToString("yyyy-MM-dd")));
            lstControls.Add(txtCCRQ);

            LoginHelper.ControlNames ctlEDGL = new LoginHelper.ControlNames(txtEDGL.ID, "");
            lstCtl.Add(ctlEDGL);
            lstControls.Add(txtEDGL);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDNJ.ID, ""));
            lstControls.Add(txtEDNJ);

            LoginHelper.ControlNames ctlEDNJZS = new LoginHelper.ControlNames(txtEDNJZS.ID, "");
            lstCtl.Add(ctlEDNJZS);
            lstControls.Add(txtEDNJZS);

            LoginHelper.ControlNames ctlYZLJ = new LoginHelper.ControlNames(txtYZLJ.ID, "");
            lstCtl.Add(ctlYZLJ);
            lstControls.Add(txtYZLJ);

            LoginHelper.ControlNames ctlQDZKZZL = new LoginHelper.ControlNames(txtQDZKZZL.ID, "");
            lstCtl.Add(ctlQDZKZZL);
            lstControls.Add(txtQDZKZZL);

            LoginHelper.ControlNames ctlHDZH = new LoginHelper.ControlNames(txtHDZH.ID, "");
            lstCtl.Add(ctlHDZH);
            lstControls.Add(txtHDZH);

            LoginHelper.ControlNames ctlLJXSLC = new LoginHelper.ControlNames(txtLJXSLC.ID, "");
            lstCtl.Add(ctlLJXSLC);
            lstControls.Add(txtLJXSLC);

            LoginHelper.ControlNames ctlLYYZH = new LoginHelper.ControlNames(txtYYZH.ID, "");
            lstCtl.Add(ctlLYYZH);
            lstControls.Add(txtYYZH);

            LoginHelper.ControlNames ctlXZQY = new LoginHelper.ControlNames(txtXZQY.ID, "");
            lstCtl.Add(ctlXZQY);
            lstControls.Add(txtXZQY);

            LoginHelper.ControlNames ctlZCZWZ = new LoginHelper.ControlNames(chkZCZWZ.ID, "2,");
            lstCtl.Add(ctlZCZWZ);
            lstControls.Add(chkZCZWZ);

            lstCtl.Add(new LoginHelper.ControlNames(chkJYXM.ID, ""));
            lstControls.Add(chkJYXM);

            lstCtl.Add(new LoginHelper.ControlNames(txtAddress.ID, ""));
            lstControls.Add(txtAddress);

            lstCtl.Add(new LoginHelper.ControlNames(txtFDJXH.ID, ""));
            lstControls.Add(txtFDJXH);

            lstCtl.Add(new LoginHelper.ControlNames(rbtnTest.ID, ""));
            lstControls.Add(rbtnTest);

            lstCtl.Add(new LoginHelper.ControlNames(txtYDXZ.ID, ""));
            lstControls.Add(txtYDXZ);

            lstCtl.Add(new LoginHelper.ControlNames(txtYHSD.ID, ""));
            lstControls.Add(txtYHSD);

            lstCtl.Add(new LoginHelper.ControlNames(txtYHXZ.ID, ""));
            lstControls.Add(txtYHXZ);

            hidID.Value = "";

            foreach (var v in lstItems)
            {
                v.Selected = false;
            }

            LoginHelper.ResetAllControls(lstCtl, lstControls);
            drpZZS_SelectedIndexChanged(null, null);

            btnSave.Enabled = true;
            btnSave.CssClass = "btnSaveEnabled";
        }

        private void ReBindJCXM()
        {
            int iZZS = Convert.ToInt32(drpZZS.SelectedValue);
            int iQZDE = Convert.ToInt32(drpQZDZ.SelectedValue);
            chkJYXM.Items.Clear();

            for (int i = 0; i < lstItems.Count; i++)
            {
                if (lstItems[i].Value.Substring(0, 1) == "B" || lstItems[i].Value.Substring(0, 1) == "Z")
                {
                    if (Convert.ToInt32(lstItems[i].Value.Substring(1, 1)) <= iZZS || lstItems[i].Value == "B9")
                    {
                        chkJYXM.Items.Add(lstItems[i]);
                    }
                }
                else if (lstItems[i].Value.Substring(0, 1) == "Z")
                {
                }
                else if (lstItems[i].Value.Substring(0, 1) == "H")
                {
                    if (iQZDE == 2)
                    {
                        if (Convert.ToInt32(lstItems[i].Value.Substring(1, 1)) == 1 || Convert.ToInt32(lstItems[i].Value.Substring(1, 1)) == 4)
                        {
                            chkJYXM.Items.Add(lstItems[i]);
                        }
                    }
                    else
                    {
                        chkJYXM.Items.Add(lstItems[i]);
                    }
                }
                else
                {
                    chkJYXM.Items.Add(lstItems[i]);
                }
            }
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string strHPHM = txtHPHMStart.Text.Trim().ToUpper() + txtHPHM.Text.Trim().ToUpper();
            string strVIN = txtVIN.Text.Trim().ToUpper();
            string strHPZL = drpHPZL.SelectedItem.Value;

            if (string.IsNullOrEmpty(strHPHM) && string.IsNullOrEmpty(strVIN))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请输入号牌号码或者VIN进行查询！");
                return;
            }
            if (chkSFLW.Checked)
            {
                string strJYJGBH = "xxxx";

                string xtlb = "";//系统类别
                string jkxlh = "";//接口序列号
                string jkid = "";//接口标志

                var doc = new XDocument(
                    new XElement("root",
                        new XElement("QueryCondition",
                            new XElement("hphm", strHPHM),
                            new XElement("hpzl", strHPZL),
                            new XElement("clsbdh", strVIN),
                            new XElement("jyjgbh", strJYJGBH)
                            )
                        )
                    );
                string QueryXmlDoc = doc.ToString();

                localhost.myWebService call = new localhost.myWebService();
                string result = call.queryObjectOutz(xtlb, jkxlh, jkid, QueryXmlDoc);

                StringReader reader = new StringReader(result);
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(reader);
                XmlNode root = xmlDoc.SelectSingleNode("//vehispara");
                if (root != null)
                {
                    LOGIN_VEHICLE_INFO info = new LOGIN_VEHICLE_INFO();
                    info.JYLBDH = root.SelectSingleNode("jylb").InnerText;
                    info.ZYWLBDH = root.SelectSingleNode("ywlx").InnerText;
                    info.HPHM = root.SelectSingleNode("hphm").InnerText;
                    info.HPZLDH = root.SelectSingleNode("hpzl").InnerText;
                    info.VIN = root.SelectSingleNode("clsbdh").InnerText;


                    info.SYR = root.SelectSingleNode("syr").InnerText;
                    info.LXDZ = root.SelectSingleNode("zsxzqh").InnerText;
                    info.SYXZDH = root.SelectSingleNode("syxz").InnerText;
                    info.PP = root.SelectSingleNode("clpp1").InnerText;
                    info.XH = root.SelectSingleNode("clxh").InnerText;
                    info.CCRQ = root.SelectSingleNode("ccrq").InnerText;
                    info.CCDJRQ = root.SelectSingleNode("ccdjrq").InnerText;
                    info.FDJH = root.SelectSingleNode("fdjh").InnerText;
                    info.CSYS = root.SelectSingleNode("csys").InnerText;
                    info.CYS = root.SelectSingleNode("hdzk").InnerText;
                    info.ZZL = root.SelectSingleNode("zzl").InnerText;
                    info.ZBZL = root.SelectSingleNode("zbzl").InnerText;
                    info.HDZH = root.SelectSingleNode("hdzzl").InnerText;
                    info.CSC = root.SelectSingleNode("cwkc").InnerText;
                    info.CSG = root.SelectSingleNode("cwkg").InnerText;
                    info.CSK = root.SelectSingleNode("cwkk").InnerText;
                    info.ZXZLXDH = root.SelectSingleNode("zxxs").InnerText;
                    info.ZXZXJXSDH = root.SelectSingleNode("zxzxjxs").InnerText;
                    info.QZDZDH = root.SelectSingleNode("qzdz").InnerText;
                    info.YGGSNFKTDH = root.SelectSingleNode("ygddtz").InnerText;
                    info.ZCZWZ = root.SelectSingleNode("zczw").InnerText;
                    info.QDXSDH = root.SelectSingleNode("qdxs").InnerText;
                    info.JZZZWZ = root.SelectSingleNode("jzzzwz").InnerText;
                    info.RLLBDH = root.SelectSingleNode("rlzl").InnerText;
                    info.ZGSJCS = root.SelectSingleNode("zgsjcs").InnerText;
                    info.LWCXWZJLDH = root.SelectSingleNode("lwcxwzjldh").InnerText;

                    info.EDGL = root.SelectSingleNode("edgl").InnerText;
                    info.EDNJ = root.SelectSingleNode("ednj").InnerText;
                    info.EDNJZS = root.SelectSingleNode("ednjzs").InnerText;
                    info.LTGGLXDH = root.SelectSingleNode("ltgglx").InnerText;
                    info.KCLXDJ = root.SelectSingleNode("kclxdj").InnerText;
                    info.YZLJ = root.SelectSingleNode("qlj").InnerText;
                    info.QDZKZZL = root.SelectSingleNode("qdzkzzl").InnerText;
                    info.HDZH = root.SelectSingleNode("hdzh").InnerText;
                    info.LJXSLC = root.SelectSingleNode("ljxslc").InnerText;
                    info.YYZH = root.SelectSingleNode("yyzh").InnerText;
                    info.XZQY = root.SelectSingleNode("xzqy").InnerText;
                    info.BZZXSDH = root.SelectSingleNode("bzzxs").InnerText;
                    info.HCCSXS = root.SelectSingleNode("hccsxs").InnerText;
                    info.CLCCLXDH = root.SelectSingleNode("clcclx").InnerText;
                    info.ZZS = root.SelectSingleNode("zzs").InnerText;
                    info.DCZS = root.SelectSingleNode("dczs").InnerText;
                    info.GCZS = root.SelectSingleNode("gczs").InnerText;
                    info.ZJCLLXDH = root.SelectSingleNode("zjcllx").InnerText;
                    info.SFSWPC = root.SelectSingleNode("sfswpc").InnerText;
                    info.YCY = root.SelectSingleNode("ycy").InnerText;

                    LoadData(info);

                }
                else
                {
                    Response.Write("the node is not existed");
                }
            }
            else
            {
                LOGIN_VEHICLE_INFO_BLL bll = new LOGIN_VEHICLE_INFO_BLL();
                string strSql = "";
                string strJYLB = drpJYLB.SelectedValue;
                if (!string.IsNullOrEmpty(strHPHM))
                {
                    strSql = "VEHICLEID='" + drpHPZL.SelectedValue + strHPHM + "' and HPZLDH='" + strHPZL + "'";
                }
                else if (!string.IsNullOrEmpty(strVIN))
                {
                    strSql = "VIN='" + strVIN + "' and HPZLDH='" + strHPZL + "'";
                }

                LOGIN_VEHICLE_INFO[] infos = bll.GetModelList(strSql);

                if (infos.Length == 1)
                {
                    LoadData(infos[0]);
                    hidID.Value = infos[0].ID.ToString();
                    btnSend.Enabled = false;
                    btnSend.CssClass = "btnSendDisabled";
                }
                else if (infos.Length > 1)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "查询结果大于1条，显示为第一条！");
                    LoadData(infos[0]);
                    hidID.Value = infos[0].ID.ToString();
                    btnSend.Enabled = false;
                    btnSend.CssClass = "btnSendDisabled";
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "查询结果为空！");
                    btnSend.Enabled = false;
                    btnSend.CssClass = "btnSendDisabled";
                    ResetAll();
                }
            }
        }

        private void LoadData(LOGIN_VEHICLE_INFO login_Info)
        {
            //总轴数
            if (string.IsNullOrEmpty(login_Info.ZZS) == false)
            {
                drpZZS.SelectedValue = login_Info.ZZS;
                drpZZS_SelectedIndexChanged(null, null);
            }

            List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
            List<Control> lstControls = new List<Control>();

            lstCtl.Add(new LoginHelper.ControlNames(drpJYLB.ID, "JYLBDH"));
            lstControls.Add(drpJYLB);

            lstCtl.Add(new LoginHelper.ControlNames(drpHPZL.ID, "HPZLDH"));
            lstControls.Add(drpHPZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLZL.ID, "CLZLDH"));
            lstControls.Add(drpCLZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpLWCXWZJL.ID, "LWCXWZJLDH"));
            lstControls.Add(drpLWCXWZJL);

            lstCtl.Add(new LoginHelper.ControlNames(drpQZDZ.ID, "QZDZDH"));
            lstControls.Add(drpQZDZ);

            lstCtl.Add(new LoginHelper.ControlNames(drpRLLB.ID, "RLLBDH"));
            lstControls.Add(drpRLLB);

            lstCtl.Add(new LoginHelper.ControlNames(drpSYXZ.ID, "SYXZDH"));
            lstControls.Add(drpSYXZ);

            lstCtl.Add(new LoginHelper.ControlNames(drpYGGSNFKT.ID, "YGGSNFKTDH"));
            lstControls.Add(drpYGGSNFKT);

            lstCtl.Add(new LoginHelper.ControlNames(drpZXZLX.ID, "ZXZLXDH"));
            lstControls.Add(drpZXZLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpZXZXJXS.ID, "ZXZXJXSDH"));
            lstControls.Add(drpZXZXJXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpLTGGLX.ID, "LTGGLXDH"));
            lstControls.Add(drpLTGGLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpKCLXDJ.ID, "KCLXDJ"));
            lstControls.Add(drpKCLXDJ);

            lstCtl.Add(new LoginHelper.ControlNames(drpBZZXS.ID, "BZZXSDH"));
            lstControls.Add(drpBZZXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLCCLX.ID, "CLCCLXDH"));
            lstControls.Add(drpCLCCLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpQDXS.ID, "QDXSDH"));
            lstControls.Add(drpQDXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpZJCLLX.ID, "ZJCLLXDH"));
            lstControls.Add(drpZJCLLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpSFSWPC.ID, "SFSWPC"));
            lstControls.Add(drpSFSWPC);

            lstCtl.Add(new LoginHelper.ControlNames(drpYWLX.ID, "YWLX"));
            lstControls.Add(drpYWLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpHCCSXS.ID, "HCCSXS"));
            lstControls.Add(drpHCCSXS);

            lstCtl.Add(new LoginHelper.ControlNames(chkZCZWZ.ID, "ZCZWZ"));
            lstControls.Add(chkZCZWZ);

            lstCtl.Add(new LoginHelper.ControlNames(chkQDZWZ.ID, "QDZWZ"));
            lstControls.Add(chkQDZWZ);

            lstCtl.Add(new LoginHelper.ControlNames(txtXZQY.ID, "XZQY"));
            lstControls.Add(txtXZQY);

            lstCtl.Add(new LoginHelper.ControlNames(txtAddress.ID, "LXDZ"));
            lstControls.Add(txtAddress);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSDJRQ.ID, "CCDJRQ"));
            lstControls.Add(txtCSDJRQ);

            lstCtl.Add(new LoginHelper.ControlNames(txtFDJNumber.ID, "FDJH"));
            lstControls.Add(txtFDJNumber);

            lstCtl.Add(new LoginHelper.ControlNames(txtFDJXH.ID, "FDJXH"));
            lstControls.Add(txtFDJXH);

            lstCtl.Add(new LoginHelper.ControlNames(txtPL.ID, "FDJPL"));
            lstControls.Add(txtPL);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDZS.ID, "EDZS"));
            lstControls.Add(txtEDZS);

            lstCtl.Add(new LoginHelper.ControlNames(txtHDZZL.ID, "HDZH"));
            lstControls.Add(txtHDZZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpCSYS.ID, "CSYSDH"));
            lstControls.Add(drpCSYS);

            lstCtl.Add(new LoginHelper.ControlNames(txtHZRS.ID, "CYS"));
            lstControls.Add(txtHZRS);

            lstCtl.Add(new LoginHelper.ControlNames(txtHPHM.ID, "HPHM"));
            lstControls.Add(txtHPHM);

            lstCtl.Add(new LoginHelper.ControlNames(txtHPHMStart.ID, "HPHM"));
            lstControls.Add(txtHPHMStart);

            lstCtl.Add(new LoginHelper.ControlNames(txtSYR.ID, "SYR"));
            lstControls.Add(txtSYR);

            lstCtl.Add(new LoginHelper.ControlNames(txtPP.ID, "PP"));
            lstControls.Add(txtPP);

            lstCtl.Add(new LoginHelper.ControlNames(txtXH.ID, "XH"));
            lstControls.Add(txtXH);

            lstCtl.Add(new LoginHelper.ControlNames(txtVIN.ID, "VIN"));
            lstControls.Add(txtVIN);

            lstCtl.Add(new LoginHelper.ControlNames(txtWKCCC.ID, "CSC"));
            lstControls.Add(txtWKCCC);

            lstCtl.Add(new LoginHelper.ControlNames(txtWKCCG.ID, "CSG"));
            lstControls.Add(txtWKCCG);

            lstCtl.Add(new LoginHelper.ControlNames(txtWKCCK.ID, "CSK"));
            lstControls.Add(txtWKCCK);

            lstCtl.Add(new LoginHelper.ControlNames(txtZBZL.ID, "ZBZL"));
            lstControls.Add(txtZBZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtZGSJCS.ID, "ZGSJCS"));
            lstControls.Add(txtZGSJCS);

            lstCtl.Add(new LoginHelper.ControlNames(txtZZL.ID, "ZZL"));
            lstControls.Add(txtZZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtCCRQ.ID, "CCRQ"));
            lstControls.Add(txtCCRQ);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDGL.ID, "EDGL"));
            lstControls.Add(txtEDGL);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDNJ.ID, "EDNJ"));
            lstControls.Add(txtEDNJ);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDNJZS.ID, "EDNJZS"));
            lstControls.Add(txtEDNJZS);

            lstCtl.Add(new LoginHelper.ControlNames(txtYZLJ.ID, "YZLJ"));
            lstControls.Add(txtYZLJ);

            lstCtl.Add(new LoginHelper.ControlNames(txtQDZKZZL.ID, "QDZKZZL"));
            lstControls.Add(txtQDZKZZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtHDZH.ID, "QYCMZZZL"));
            lstControls.Add(txtHDZH);

            lstCtl.Add(new LoginHelper.ControlNames(txtLJXSLC.ID, "LJXSLC"));
            lstControls.Add(txtLJXSLC);

            lstCtl.Add(new LoginHelper.ControlNames(txtYYZH.ID, "YYZH"));
            lstControls.Add(txtYYZH);

            lstCtl.Add(new LoginHelper.ControlNames(txtYHXZ.ID, "YHXZ"));
            lstControls.Add(txtYHXZ);

            lstCtl.Add(new LoginHelper.ControlNames(txtYHSD.ID, "YHSD"));
            lstControls.Add(txtYHSD);

            lstCtl.Add(new LoginHelper.ControlNames(txtYDXZ.ID, "YDXZ"));
            lstControls.Add(txtYDXZ);

            LoginHelper.LoadData(login_Info, lstCtl, lstControls);

            drpQZDZ_SelectedIndexChanged(null, null);

            drpRLLB_SelectedIndexChanged(null, null);

            if (login_Info.SFSQCLC == "1")
            {
                chkQCLC.Checked = true;
                trOperater.Visible = false;
                divGC.Visible = true;
                BindQCLC(login_Info.GLCHPHM, login_Info.GLCHPZLDH);
            }
            else
            {
                chkQCLC.Checked = false;
                trOperater.Visible = true;
                divGC.Visible = false;
            }

            string strJYXM = "";
            LoginHelper.ConfirmJCXS(login_Info, "Z", rbtnTest, lblJCCS, out strJYXM);

            if (rbtnTest.SelectedValue == "0")
            {
                strJYXM = login_Info.JYXM;
            }

            LoginHelper.BindJYXM(strJYXM, chkJYXM, lstItems);

            btnSave.Enabled = true;
            btnSave.CssClass = "btnSaveEnabled";

            LoginHelper.ResetAllValidate(GetType(), this);
        }

        protected void btnSend_Click(object sender, EventArgs e)
        {
            bool bIsFirstTest_ZC = rbtnTest.SelectedValue == "0" ? true : false;//是否为初检
            bool bHasCharge = LoginHelper.HasCharge(hidID.Value, "Z", bIsFirstTest_ZC);
            //if (!bHasCharge)
            //{
            //    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "当前车辆没有收费，请收费后在发送！");
            //    return;
            //}

            LoginHelper.ResetAllValidate(GetType(), this);

            var dicCheckItems = LoginHelper.CheckAllInputItems(hidID.Value, "", "Z");
            if (dicCheckItems["Z"].Count > 0)
            {
                foreach (var v in dicCheckItems["Z"])
                {
                    TextBox txt = (TextBox)this.FindControl(v);
                    txt.BackColor = Color.Yellow;
                }
                return;
            }

            LOGIN_VEHICLE_INFO_BLL info_bll = new LOGIN_VEHICLE_INFO_BLL();
            var info = info_bll.GetModel(Convert.ToInt32(hidID.Value));
            if (string.IsNullOrEmpty(info.JYXM))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请选择检验项目保存后，在进行发送！");
                return;
            }

            bool bIsUpdate_ZC;
            VEHICLE_DISPATCH model_ZC = LoginHelper.GetDispathchByLoginID(hidID.Value, "Z", bIsFirstTest_ZC, out bIsUpdate_ZC);

            VEHICLE_DISPATCH_BLL disBll = new VEHICLE_DISPATCH_BLL();

            if (!bIsUpdate_ZC)
            {
                if (disBll.Insert(model_ZC))
                {
                    gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送成功！");
                    btnSend.CssClass = "btnSendDisabled";
                    btnSend.Enabled = false;
                    ResetAll();
                    LoginedList1.BindList("", "");
                    return;
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送失败！");
                    btnSend.CssClass = "btnSendEnabled";
                    btnSend.Enabled = true;
                    return;
                }
            }
            else
            {
                if (disBll.Update(model_ZC, model_ZC.JCLSH))
                {
                    gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送成功！");
                    btnSend.CssClass = "btnSendDisabled";
                    btnSend.Enabled = false;
                    ResetAll();
                    LoginedList1.BindList("", "");
                    return;
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送失败！");
                    btnSend.CssClass = "btnSendEnabled";
                    btnSend.Enabled = true;
                    return;
                }
            }
        }

        protected void btnReset_Click(object sender, EventArgs e)
        {
            ResetAll();
        }

        protected void drpZZS_SelectedIndexChanged(object sender, EventArgs e)
        {
            ReBindJCXM();
            int iZZS = Convert.ToInt32(drpZZS.SelectedValue);
            LoginHelper.BindZCZWZ(iZZS, chkZCZWZ, chkQDZWZ);
        }

        protected void drpQZDZ_SelectedIndexChanged(object sender, EventArgs e)
        {
            ReBindJCXM();
        }

        protected void chkZCZWZ_SelectedIndexChanged(object sender, EventArgs e)
        {
            bool b = false;
            for (int i = 0; i < chkZCZWZ.Items.Count; i++)
            {
                if (chkZCZWZ.Items[i].Selected)
                {
                    b = true;
                }
            }

            if (b == false)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "必须选择一个驻车轴！");
                chkZCZWZ.Items[0].Selected = true;
                return;
            }
        }

        protected void chkJYXM_SelectedIndexChanged(object sender, EventArgs e)
        {
            bool bFirstTest = rbtnTest.SelectedValue == "0" ? true : false;
            bool bIsSLQC = drpCLZL.SelectedValue == "N11" ? true : false;
            LoginHelper.JYXMChanged(chkJYXM, lstItems, bFirstTest, bIsSLQC);
        }

        protected void chkQDZWZ_SelectedIndexChanged(object sender, EventArgs e)
        {
            bool b = false;
            for (int i = 0; i < chkQDZWZ.Items.Count; i++)
            {
                if (chkQDZWZ.Items[i].Selected)
                {
                    b = true;
                }
            }

            if (b == false)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "必须选择一个驱动轴！");
                chkQDZWZ.Items[1].Selected = true;
                return;
            }
        }

        protected void btnSearchPPXH_Click(object sender, EventArgs e)
        {
            string strPP = txtPP.Text.Trim();
            string strXH = txtXH.Text.Trim().ToUpper();

            TYPE_CX_CONTENT_BLL bll = new TYPE_CX_CONTENT_BLL();
            TYPE_CX_CONTENT[] m_TYPE_CX_CONTENT = bll.GetModelList("PP='" + strPP + "' and XH='" + strXH + "' order by ID desc");

            if (m_TYPE_CX_CONTENT.Length > 0)
            {
                TYPE_CX_CONTENT vContent = m_TYPE_CX_CONTENT[0];

                if (!string.IsNullOrEmpty(vContent.ZZS))
                {
                    drpZZS.SelectedValue = vContent.ZZS;
                    drpZZS_SelectedIndexChanged(null, null);
                }

                List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
                List<Control> lstControls = new List<Control>();


                lstCtl.Add(new LoginHelper.ControlNames(drpCLZL.ID, "CLZL"));
                lstControls.Add(drpCLZL);

                lstCtl.Add(new LoginHelper.ControlNames(drpQZDZ.ID, "QZDZ"));
                lstControls.Add(drpQZDZ);

                lstCtl.Add(new LoginHelper.ControlNames(drpRLLB.ID, "RLLB"));
                lstControls.Add(drpRLLB);

                lstCtl.Add(new LoginHelper.ControlNames(drpZXZLX.ID, "ZXZLX"));
                lstControls.Add(drpZXZLX);

                lstCtl.Add(new LoginHelper.ControlNames(drpZXZXJXS.ID, "ZXZXJXS"));
                lstControls.Add(drpZXZXJXS);

                lstCtl.Add(new LoginHelper.ControlNames(drpLTGGLX.ID, "LTGGLXDH"));
                lstControls.Add(drpLTGGLX);

                lstCtl.Add(new LoginHelper.ControlNames(drpBZZXS.ID, "BZZXS"));
                lstControls.Add(drpBZZXS);

                lstCtl.Add(new LoginHelper.ControlNames(chkZCZWZ.ID, "ZCZWZ"));
                lstControls.Add(chkZCZWZ);

                lstCtl.Add(new LoginHelper.ControlNames(chkQDZWZ.ID, "QDZWZ"));
                lstControls.Add(chkQDZWZ);

                lstCtl.Add(new LoginHelper.ControlNames(txtHDZZL.ID, "HDZH"));
                lstControls.Add(txtHDZZL);

                lstCtl.Add(new LoginHelper.ControlNames(drpCSYS.ID, "CSYSDH"));
                lstControls.Add(drpCSYS);

                lstCtl.Add(new LoginHelper.ControlNames(txtHZRS.ID, "CYS"));
                lstControls.Add(txtHZRS);

                lstCtl.Add(new LoginHelper.ControlNames(txtWKCCC.ID, "CSC"));
                lstControls.Add(txtWKCCC);

                lstCtl.Add(new LoginHelper.ControlNames(txtWKCCG.ID, "CSG"));
                lstControls.Add(txtWKCCG);

                lstCtl.Add(new LoginHelper.ControlNames(txtWKCCK.ID, "CSK"));
                lstControls.Add(txtWKCCK);

                lstCtl.Add(new LoginHelper.ControlNames(txtZBZL.ID, "ZBZL"));
                lstControls.Add(txtZBZL);

                lstCtl.Add(new LoginHelper.ControlNames(txtZGSJCS.ID, "ZGSJCS"));
                lstControls.Add(txtZGSJCS);

                lstCtl.Add(new LoginHelper.ControlNames(txtZZL.ID, "ZZL"));
                lstControls.Add(txtZZL);

                //lstCtl.Add(new LoginHelper.ControlNames("txtEDGL", "EDGL"));
                //lstControls.Add(txtEDGL);

                //lstCtl.Add(new LoginHelper.ControlNames("txtEDNJ", "EDNJ"));
                //lstControls.Add(txtEDNJ);

                //lstCtl.Add(new LoginHelper.ControlNames("txtEDNJZS", "EDNJZS"));
                //lstControls.Add(txtEDNJZS);

                if (divYHYD.Visible)
                {
                    lstCtl.Add(new LoginHelper.ControlNames(txtYDXZ.ID, "YDXZ"));
                    lstControls.Add(txtYDXZ);

                    lstCtl.Add(new LoginHelper.ControlNames(txtYHSD.ID, "YHSD"));
                    lstControls.Add(txtYHSD);

                    lstCtl.Add(new LoginHelper.ControlNames(txtYHXZ.ID, "YHXZ"));
                    lstControls.Add(txtYHXZ);
                }

                lstCtl.Add(new LoginHelper.ControlNames(txtHDZH.ID, "QYCMZZZL"));
                lstControls.Add(txtHDZH);

                LoginHelper.GetPPXH(vContent, lstCtl, lstControls);
            }
        }

        protected void chkQCLC_CheckedChanged(object sender, EventArgs e)
        {
            if (chkQCLC.Checked)
            {
                trOperater.Visible = false;
                divGC.Visible = true;
            }
            else
            {
                trOperater.Visible = true;
                divGC.Visible = false;
            }
        }

        protected void drpZZSGC_SelectedIndexChanged(object sender, EventArgs e)
        {
            int iZZS = Convert.ToInt32(drpZZSGC.SelectedValue);
            LoginHelper.BindJCXMGC_ZJ(iZZS, chkJYXMGC, lstItemsGC);
            LoginHelper.BindZCZWZ(iZZS, chkZCZWZGC);
        }

        protected void btnSearchGC_Click(object sender, EventArgs e)
        {
            string strHPHM = txtHPHMStartGC.Text.Trim().ToUpper() + txtHPHMGC.Text.Trim().ToUpper();
            string strVIN = txtVINGC.Text.Trim().ToUpper();
            string strHPZL = drpHPZLGC.SelectedItem.Value;

            if (string.IsNullOrEmpty(strHPHM) && string.IsNullOrEmpty(strVIN))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请输入号牌号码或者VIN进行查询！");
                return;
            }

            if (!strHPHM.Contains("挂"))
            {
                strHPHM = strHPHM + "挂";
            }
            if (chkSFLW.Checked)
            {
                string strJYJGBH = "xxxx";

                string xtlb = "";//系统类别
                string jkxlh = "";//接口序列号
                string jkid = "";//接口标志

                var doc = new XDocument(
                    new XElement("root",
                        new XElement("QueryCondition",
                            new XElement("hphm", strHPHM),
                            new XElement("hpzl", strHPZL),
                            new XElement("clsbdh", strVIN),
                            new XElement("jyjgbh", strJYJGBH)
                            )
                        )
                    );
                string QueryXmlDoc = doc.ToString();

                localhost.myWebService call = new localhost.myWebService();
                string result = call.queryObjectOutz(xtlb, jkxlh, jkid, QueryXmlDoc);

                StringReader reader = new StringReader(result);
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(reader);
                XmlNode root = xmlDoc.SelectSingleNode("//vehispara");
                if (root != null)
                {
                    LOGIN_VEHICLE_INFO info = new LOGIN_VEHICLE_INFO();
                    info.JYLBDH = root.SelectSingleNode("jylb").InnerText;
                    info.ZYWLBDH = root.SelectSingleNode("ywlx").InnerText;
                    info.HPHM = root.SelectSingleNode("hphm").InnerText;
                    info.HPZLDH = root.SelectSingleNode("hpzl").InnerText;
                    info.VIN = root.SelectSingleNode("clsbdh").InnerText;


                    info.SYR = root.SelectSingleNode("syr").InnerText;
                    info.LXDZ = root.SelectSingleNode("zsxzqh").InnerText;
                    info.SYXZDH = root.SelectSingleNode("syxz").InnerText;
                    info.PP = root.SelectSingleNode("clpp1").InnerText;
                    info.XH = root.SelectSingleNode("clxh").InnerText;
                    info.CCRQ = root.SelectSingleNode("ccrq").InnerText;
                    info.CCDJRQ = root.SelectSingleNode("ccdjrq").InnerText;
                    info.FDJH = root.SelectSingleNode("fdjh").InnerText;
                    info.CSYS = root.SelectSingleNode("csys").InnerText;
                    info.CYS = root.SelectSingleNode("hdzk").InnerText;
                    info.ZZL = root.SelectSingleNode("zzl").InnerText;
                    info.ZBZL = root.SelectSingleNode("zbzl").InnerText;
                    info.HDZH = root.SelectSingleNode("hdzzl").InnerText;
                    info.CSC = root.SelectSingleNode("cwkc").InnerText;
                    info.CSG = root.SelectSingleNode("cwkg").InnerText;
                    info.CSK = root.SelectSingleNode("cwkk").InnerText;
                    info.ZXZLXDH = root.SelectSingleNode("zxxs").InnerText;
                    info.ZXZXJXSDH = root.SelectSingleNode("zxzxjxs").InnerText;
                    info.QZDZDH = root.SelectSingleNode("qzdz").InnerText;
                    info.YGGSNFKTDH = root.SelectSingleNode("ygddtz").InnerText;
                    info.ZCZWZ = root.SelectSingleNode("zczw").InnerText;
                    info.QDXSDH = root.SelectSingleNode("qdxs").InnerText;
                    info.JZZZWZ = root.SelectSingleNode("jzzzwz").InnerText;
                    info.RLLBDH = root.SelectSingleNode("rlzl").InnerText;
                    info.ZGSJCS = root.SelectSingleNode("zgsjcs").InnerText;
                    info.LWCXWZJLDH = root.SelectSingleNode("lwcxwzjldh").InnerText;

                    info.EDGL = root.SelectSingleNode("edgl").InnerText;
                    info.EDNJ = root.SelectSingleNode("ednj").InnerText;
                    info.EDNJZS = root.SelectSingleNode("ednjzs").InnerText;
                    info.LTGGLXDH = root.SelectSingleNode("ltgglx").InnerText;
                    info.KCLXDJ = root.SelectSingleNode("kclxdj").InnerText;
                    info.YZLJ = root.SelectSingleNode("qlj").InnerText;
                    info.QDZKZZL = root.SelectSingleNode("qdzkzzl").InnerText;
                    info.HDZH = root.SelectSingleNode("hdzh").InnerText;
                    info.LJXSLC = root.SelectSingleNode("ljxslc").InnerText;
                    info.YYZH = root.SelectSingleNode("yyzh").InnerText;
                    info.XZQY = root.SelectSingleNode("xzqy").InnerText;
                    info.BZZXSDH = root.SelectSingleNode("bzzxs").InnerText;
                    info.HCCSXS = root.SelectSingleNode("hccsxs").InnerText;
                    info.CLCCLXDH = root.SelectSingleNode("clcclx").InnerText;
                    info.ZZS = root.SelectSingleNode("zzs").InnerText;
                    info.DCZS = root.SelectSingleNode("dczs").InnerText;
                    info.GCZS = root.SelectSingleNode("gczs").InnerText;
                    info.ZJCLLXDH = root.SelectSingleNode("zjcllx").InnerText;
                    info.SFSWPC = root.SelectSingleNode("sfswpc").InnerText;
                    info.YCY = root.SelectSingleNode("ycy").InnerText;

                    LoadData(info);

                }
                else
                {
                    Response.Write("the node is not existed");
                }
            }
            else
            {
                LOGIN_VEHICLE_INFO_BLL bll = new LOGIN_VEHICLE_INFO_BLL();
                string strSql = "";
                if (!string.IsNullOrEmpty(strHPHM))
                {
                    strSql = "VEHICLEID='" + strHPZL + strHPHM + "' and HPZLDH='" + strHPZL + "'";
                }
                else if (!string.IsNullOrEmpty(strVIN))
                {
                    strSql = "VIN='" + strVIN + "' and HPZLDH='" + strHPZL + "'";
                }

                LOGIN_VEHICLE_INFO[] infos = bll.GetModelList(strSql);

                if (infos.Length == 1)
                {
                    BindQCLC(infos[0].HPHM, infos[0].HPZLDH);
                    hidGCID.Value = infos[0].ID.ToString();
                }
                else if (infos.Length > 1)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "查询结果大于1条，显示为第一条！");
                    BindQCLC(infos[0].HPHM, infos[0].HPZLDH);
                    hidGCID.Value = infos[0].ID.ToString();
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "查询结果为空！");
                    ResetAll();
                }
            }
        }

        protected void chkJYXMGC_SelectedIndexChanged(object sender, EventArgs e)
        {
            bool bFirstTest = rbtnTestGC.SelectedValue == "0" ? true : false;
            LoginHelper.JYXMChanged(chkJYXMGC, lstItemsGC, bFirstTest);
        }

        private void BindQCLC(string strHPHMGC, string strHPZLDHGC)
        {
            var vInfo = LoginHelper.GetLoginInfo(strHPHMGC, strHPZLDHGC);

            //总轴数
            if (string.IsNullOrEmpty(vInfo.ZZS) == false)
            {
                drpZZSGC.SelectedValue = vInfo.ZZS;
                drpZZSGC_SelectedIndexChanged(null, null);
            }

            List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
            List<Control> lstControls = new List<Control>();

            lstCtl.Add(new LoginHelper.ControlNames(drpJYLBGC.ID.ToString(), "JYLBDH"));
            lstControls.Add(drpJYLBGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtZJLSHGC.ID.ToString(), "ZJLSH"));
            lstControls.Add(txtZJLSHGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtHPHMGC.ID.ToString(), "HPHM"));
            lstControls.Add(txtHPHMGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpHPZLGC.ID.ToString(), "HPZLDH"));
            lstControls.Add(drpHPZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtVINGC.ID.ToString(), "VIN"));
            lstControls.Add(txtVINGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLZLGC.ID.ToString(), "CLZLDH"));
            lstControls.Add(drpCLZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtSYRGC.ID.ToString(), "SYR"));
            lstControls.Add(txtSYRGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtAddressGC.ID.ToString(), "LXDZ"));
            lstControls.Add(txtAddressGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpSYXZGC.ID.ToString(), "SYXZDH"));
            lstControls.Add(drpSYXZGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtPPGC.ID.ToString(), "PP"));
            lstControls.Add(txtPPGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtXHGC.ID.ToString(), "XH"));
            lstControls.Add(txtXHGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCCRQGC.ID.ToString(), "CCRQ"));
            lstControls.Add(txtCCRQGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSDJRQGC.ID.ToString(), "CCDJRQ"));
            lstControls.Add(txtCSDJRQGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtZZLGC.ID.ToString(), "ZZL"));
            lstControls.Add(txtZZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpCSYSGC.ID, "CSYSDH"));
            lstControls.Add(drpCSYSGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtZBZLGC.ID.ToString(), "ZBZL"));
            lstControls.Add(txtZBZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtHDZZLGC.ID.ToString(), "HDZH"));
            lstControls.Add(txtHDZZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSCGC.ID.ToString(), "CSC"));
            lstControls.Add(txtCSCGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSKGC.ID.ToString(), "CSK"));
            lstControls.Add(txtCSKGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSGGC.ID.ToString(), "CSG"));
            lstControls.Add(txtCSGGC);

            lstCtl.Add(new LoginHelper.ControlNames(chkZCZWZGC.ID.ToString(), "ZCZWZ"));
            lstControls.Add(chkZCZWZGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpLWCXWZJLGC.ID.ToString(), "LWCXWZJLDH"));
            lstControls.Add(drpLWCXWZJLGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpZJCLLXGC.ID.ToString(), "ZJCLLXDH"));
            lstControls.Add(drpZJCLLXGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpHCCSXSGC.ID.ToString(), "HCCSXS"));
            lstControls.Add(drpHCCSXSGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtYYZHGC.ID.ToString(), "YYZH"));
            lstControls.Add(txtYYZHGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLCCLXGC.ID.ToString(), "CLCCLX"));
            lstControls.Add(drpCLCCLXGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpBZZXSGC.ID.ToString(), "BZZXSDH"));
            lstControls.Add(drpBZZXSGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtXZQYGC.ID.ToString(), "XZQY"));
            lstControls.Add(txtXZQYGC);

            LoginHelper.LoadData(vInfo, lstCtl, lstControls);
            string strJYXM = "";
            LoginHelper.ConfirmJCXS(vInfo, "Z", rbtnTestGC,lblJCCSGC,out strJYXM);
            if (rbtnTestGC.SelectedValue == "0")
            {
                strJYXM = vInfo.JYXM;
            }

            LoginHelper.BindJYXM(strJYXM, chkJYXMGC, lstItemsGC);
        }

        protected void btnSaveGC_Click(object sender, EventArgs e)
        {
            #region 主车
            //综检检验登录
            string strJYLB = drpJYLB.SelectedValue.Trim() + ",";
            string strHPHM_H = txtHPHMStart.Text.Trim().ToUpper();
            string strHPHM_C = txtHPHM.Text.Trim().ToUpper();
            string strHPHM = txtHPHMStart.Text.Trim().ToUpper() + txtHPHM.Text.Trim().ToUpper();
            string strHPZL = drpHPZL.SelectedValue.Trim();
            string strVIN = txtVIN.Text.Trim().ToUpper();
            string strSYR = txtSYR.Text.Trim();
            string strAddress = txtAddress.Text.Trim();
            string strPP = txtPP.Text.Trim();
            string strXH = txtXH.Text.Trim().ToUpper();
            string strFDJXH = txtFDJXH.Text.Trim().ToUpper();
            string strFDJHM = txtFDJNumber.Text.Trim().ToUpper();
            string strCCRQ = txtCCRQ.Text.Trim();
            string strHZRS = txtHZRS.Text.Trim();
            string strCSDJRQ = txtCSDJRQ.Text.Trim();
            string strZZL = txtZZL.Text.Trim();
            string strZBZL = txtZBZL.Text.Trim();
            string strHDZZL = txtHDZZL.Text.Trim();
            string strWKCCC = txtWKCCC.Text.Trim();
            string strWKCCK = txtWKCCK.Text.Trim();
            string strWKCCG = txtWKCCG.Text.Trim();
            string strQDZWZ = "";//驱动轴位置
            string strZGSJCS = txtZGSJCS.Text.Trim();
            string strEDGL = txtEDGL.Text.Trim();
            string strEDNJ = txtEDNJ.Text.Trim();
            string strEDNJZS = txtEDNJZS.Text.Trim();
            string strYZLJ = txtYZLJ.Text.Trim();
            string strQDZKZZL = txtQDZKZZL.Text.Trim();
            string strHDZH = txtHDZH.Text.Trim();
            string strLJXSLC = txtLJXSLC.Text.Trim();
            string strYYZH = txtYYZH.Text.Trim();
            string strXZQY = txtXZQY.Text.Trim();
            string strPL = txtPL.Text.Trim();
            string strEDZS = txtEDZS.Text.Trim();
            string strZCZWZ = "";
            string strJYXM = "";
            string strSFSQCLC = chkQCLC.Checked ? "1" : "0";
            string strVEHICLEID = strHPZL + strHPHM;

            string strYHXZ = txtYHXZ.Text.Trim();
            string strYHSD = txtYHSD.Text.Trim();
            string strYDXZ = txtYDXZ.Text.Trim();

            bool bChecked = CheckAllTextBox();
            if (!bChecked)
            {
                return;
            }

            for (int i = 0; i < chkZCZWZ.Items.Count; i++)
            {
                if (chkZCZWZ.Items[i].Selected)
                {
                    strZCZWZ += chkZCZWZ.Items[i].Value + ",";
                }
            }

            for (int i = 0; i < chkQDZWZ.Items.Count; i++)
            {
                if (chkQDZWZ.Items[i].Selected)
                {
                    strQDZWZ += chkQDZWZ.Items[i].Value + ",";
                }
            }

            for (int i = 0; i < chkJYXM.Items.Count; i++)
            {
                if (chkJYXM.Items[i].Selected)
                {
                    strJYXM += chkJYXM.Items[i].Value + ",";
                }
            }

            #endregion

            #region 挂车
            string strJYLBGC = drpJYLBGC.SelectedValue + ",";
            string strZJLSHGC = txtZJLSHGC.Text.Trim();
            string strHPHMGC_C = txtHPHMGC.Text.Trim().ToUpper();
            string strHPHMGC_H = txtHPHMStartGC.Text.Trim().ToUpper();
            string strHPHMGC = strHPHMGC_H + strHPHMGC_C;
            if (!strHPHMGC.Contains("挂"))
            {
                strHPHMGC += "挂";
            }

            string strHPZLGC = drpHPZLGC.SelectedValue;
            string strVINGC = txtVINGC.Text.Trim().ToUpper();

            string strVEHICLEIDGC = strHPZLGC + strHPHMGC;

            string strCLZLGC = drpCLZLGC.SelectedValue;
            string strSYRGC = txtSYRGC.Text.Trim();
            string strAddressGC = txtAddressGC.Text.Trim();
            string strSYXZGC = drpSYXZGC.SelectedValue;
            string strPPGC = txtPPGC.Text.Trim();
            string strXHGC = txtXHGC.Text.Trim().ToUpper();
            string strCCRQGC = txtCCRQGC.Text.Trim();
            string strCCDJRQGC = txtCSDJRQGC.Text.Trim();
            string strZZLGC = txtZZLGC.Text.Trim();
            string strZBZLGC = txtZBZLGC.Text.Trim();
            string strHDZZLGC = txtHDZZLGC.Text.Trim();
            string strCSCGC = txtCSCGC.Text.Trim();
            string strCSKGC = txtCSKGC.Text.Trim();
            string strCSGGC = txtCSGGC.Text.Trim();
            string strZZSGC = drpZZSGC.SelectedValue;
            string strZCZWZGC = "";
            string strXZQYGC = txtXZQYGC.Text.Trim();
            string strZJCLLXGC = drpZJCLLXGC.SelectedValue;
            string strTestStatus = rbtnTestGC.SelectedValue;
            string strWCXWZJLGC = drpLWCXWZJLGC.SelectedValue;
            string strHCCSXSGC = drpHCCSXSGC.SelectedValue;
            string strYYZHGC = txtYYZHGC.Text.Trim();
            string strCLCCLXGC = drpCLCCLXGC.SelectedValue;
            string strBZZXSGC = drpBZZXSGC.SelectedValue;
            string strJYXMGC = "";

            if (string.IsNullOrEmpty(strHPHMGC_H))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车号牌号码开头不能为空！");
                txtHPHMStartGC.Focus();
                txtHPHMStartGC.BackColor = Color.Yellow;
                return;
            }
            else
            {
                txtHPHMStartGC.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strHPHMGC_C))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车号牌号码不能为空！");
                txtHPHMGC.Focus();
                txtHPHMGC.BackColor = Color.Yellow;
                return;
            }
            else
            {
                txtHPHMGC.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strCCRQGC) == false)
            {
                if (gfValidate.Is_DateTime(strCCRQGC) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车出厂年月不是有效的日期格式！");
                    txtCCRQGC.Focus();
                    txtCCRQGC.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtCCRQGC.BackColor = Color.White;
                }
            }

            if (string.IsNullOrEmpty(strCCDJRQGC) == false)
            {
                if (gfValidate.Is_DateTime(strCCRQGC) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车初始登记日期不是有效的日期格式！");
                    txtCSDJRQGC.Focus();
                    txtCSDJRQGC.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtCSDJRQGC.BackColor = Color.White;
                }
            }

            if (string.IsNullOrEmpty(strZZLGC) == false && !gfValidate.Is_Integer(strZZLGC))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车总质量不是整数！");
                txtZZLGC.Focus();
                txtZZLGC.BackColor = Color.Yellow;
                return;
            }
            else
            {
                txtZZLGC.BackColor = Color.White;
            }

            if (!string.IsNullOrEmpty(strZBZLGC) && !gfValidate.Is_Integer(strZBZLGC))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车整备质量不是整数！");
                txtZBZLGC.Focus();
                txtZBZLGC.BackColor = Color.Yellow;
                return;
            }
            else
            {
                txtZBZLGC.BackColor = Color.White;
            }

            if (!string.IsNullOrEmpty(strHDZZLGC))
            {
                if (gfLibrary.gfValidate.Is_Integer(strHDZZLGC) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车核定载质量不是整数！");
                    txtHDZZLGC.Focus();
                    txtHDZZLGC.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtHDZZLGC.BackColor = Color.White;
                }
            }

            if (string.IsNullOrEmpty(strCSCGC) == false && gfValidate.Is_Integer(strCSCGC) == false)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车车身长不是整数！");
                txtCSCGC.Focus();
                txtCSCGC.BackColor = Color.Yellow;
                return;
            }
            else
            {
                txtCSCGC.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strCSKGC) == false && gfValidate.Is_Integer(strCSKGC) == false)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车车身宽不是整数！");
                txtCSKGC.Focus();
                txtCSKGC.BackColor = Color.Yellow;
                return;
            }
            else
            {
                txtCSKGC.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strCSGGC) == false && gfValidate.Is_Integer(strCSGGC) == false)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "挂车车身高不是整数！");
                txtCSGGC.Focus();
                txtCSGGC.BackColor = Color.Yellow;
                return;
            }
            else
            {
                txtCSGGC.BackColor = Color.White;
            }

            for (int i = 0; i < chkZCZWZGC.Items.Count; i++)
            {
                if (chkZCZWZGC.Items[i].Selected)
                {
                    strZCZWZGC += chkZCZWZGC.Items[i].Value + ",";
                }
            }

            for (int i = 0; i < chkJYXMGC.Items.Count; i++)
            {
                if (chkJYXMGC.Items[i].Selected)
                {
                    strJYXMGC += chkJYXMGC.Items[i].Value + ",";
                }
            }
            #endregion

            LOGIN_VEHICLE_INFO info_ZC = new LOGIN_VEHICLE_INFO();
            info_ZC.VEHICLEID = strVEHICLEID;
            info_ZC.HPHM = strHPHM;
            info_ZC.HPZL = drpHPZL.SelectedItem.Text;
            info_ZC.HPZLDH = strHPZL;
            info_ZC.VIN = strVIN;
            info_ZC.JYLB = drpJYLB.SelectedItem.Text;
            info_ZC.JYLBDH = strJYLB;
            info_ZC.CLZL = drpCLZL.SelectedItem.Text;
            info_ZC.CLZLDH = drpCLZL.SelectedItem.Value;
            info_ZC.FDJH = strFDJHM;
            info_ZC.FDJXH = strFDJXH;
            info_ZC.PP = strPP;
            info_ZC.XH = strXH;
            info_ZC.PPXH = strPP + strXH;
            info_ZC.QDZWZ = strQDZWZ;
            info_ZC.ZCZWZ = strZCZWZ;
            info_ZC.QZDZ = drpQZDZ.SelectedItem.Text;
            info_ZC.QZDZDH = drpQZDZ.SelectedItem.Value;
            info_ZC.YGGSNFKT = drpYGGSNFKT.SelectedItem.Text;
            info_ZC.YGGSNFKTDH = drpYGGSNFKT.SelectedItem.Value;
            info_ZC.RLLB = drpRLLB.SelectedItem.Text;
            info_ZC.RLLBDH = drpRLLB.SelectedItem.Value;
            info_ZC.CCDJRQ = strCSDJRQ;
            info_ZC.CCRQ = strCCRQ;
            info_ZC.CSYS = drpCSYS.SelectedItem.Text;
            info_ZC.CSYSDH = drpCSYS.SelectedValue;
            info_ZC.ZBZL = strZBZL;
            info_ZC.ZZL = strZZL;
            info_ZC.CYS = strHZRS;
            info_ZC.ZXZXJXS = drpZXZXJXS.SelectedItem.Text;
            info_ZC.ZXZXJXSDH = drpZXZXJXS.SelectedItem.Value;
            info_ZC.ZXZLX = drpZXZLX.SelectedItem.Text;
            info_ZC.ZXZLXDH = drpZXZLX.SelectedItem.Value;
            info_ZC.ZGSJCS = strZGSJCS;
            info_ZC.SYR = strSYR;
            info_ZC.LXDZ = strAddress;
            info_ZC.SYXZ = drpSYXZ.SelectedItem.Text;
            info_ZC.SYXZDH = drpSYXZ.SelectedItem.Value;
            info_ZC.HDZH = strHDZZL;
            info_ZC.JYXM_LW = strJYXM;
            info_ZC.JYXM = strJYXM;
            info_ZC.CSC = strWKCCC;
            info_ZC.CSK = strWKCCK;
            info_ZC.CSG = strWKCCG;
            info_ZC.DLY = userInfo.UserName;
            info_ZC.QDZWZ = strQDZWZ;
            info_ZC.LWCXWZJLDH = drpLWCXWZJL.SelectedItem.Value;
            info_ZC.LWCXWZJL = drpLWCXWZJL.SelectedItem.Text;
            info_ZC.ZZS = drpZZS.SelectedItem.Value;
            info_ZC.QDXSDH = drpQDXS.SelectedItem.Value;
            info_ZC.QDXS = drpQDXS.SelectedItem.Text;
            info_ZC.ZJLSH = txtZJLSH.Text.Trim();
            info_ZC.SFSQCLC = strSFSQCLC;
            info_ZC.GLCHPHM = strHPHMGC;
            info_ZC.GLCHPZLDH = strHPZLGC;
            info_ZC.GLCHPZL = drpHPZLGC.SelectedItem.Text;
            info_ZC.GLCJYXM = strJYXMGC;
            info_ZC.FDJPL = strPL;
            info_ZC.EDZS = strEDZS;

            //综检
            info_ZC.CCRQ = strCCRQ;
            info_ZC.EDGL = strEDGL;
            info_ZC.EDNJ = strEDNJ;
            info_ZC.EDNJZS = strEDNJZS;
            info_ZC.LTGGLX = drpLTGGLX.SelectedItem.Text;
            info_ZC.LTGGLXDH = drpLTGGLX.SelectedItem.Value;
            info_ZC.KCLXDJ = drpKCLXDJ.SelectedItem.Text;
            info_ZC.YZLJ = strYZLJ;
            info_ZC.QDZKZZL = strQDZKZZL;
            info_ZC.QYCMZZZL = strHDZH;
            info_ZC.LJXSLC = strLJXSLC;
            info_ZC.YYZH = strYYZH;
            info_ZC.XZQY = strXZQY;
            info_ZC.BZZXS = drpBZZXS.SelectedItem.Text;
            info_ZC.BZZXSDH = drpBZZXS.SelectedItem.Value;
            info_ZC.HCCSXS = drpHCCSXS.SelectedItem.Value;
            info_ZC.CLCCLX = drpCLCCLX.SelectedItem.Text;
            info_ZC.CLCCLXDH = drpCLCCLX.SelectedItem.Value;
            info_ZC.ZJCLLX = drpZJCLLX.SelectedItem.Text;
            info_ZC.ZJCLLXDH = drpZJCLLX.SelectedItem.Value;
            info_ZC.SFSWPC = drpSFSWPC.SelectedItem.Text;
            info_ZC.YWLX = drpYWLX.SelectedItem.Text;
            if (divYHYD.Visible)
            {
                info_ZC.YDXZ = strYDXZ;
                info_ZC.YHSD = strYHSD;
                info_ZC.YHXZ = strYHXZ;
            }

            LOGIN_VEHICLE_INFO info_GC = new LOGIN_VEHICLE_INFO();
            info_GC.VEHICLEID = strHPZLGC + strHPHMGC;
            info_GC.HPHM = strHPHMGC;
            info_GC.HPZL = drpHPZLGC.SelectedItem.Text;
            info_GC.HPZLDH = strHPZLGC;
            info_GC.VIN = strVINGC;
            info_GC.JYLB = drpJYLBGC.SelectedItem.Text;
            info_GC.JYLBDH = strJYLBGC;
            info_GC.PP = strPPGC;
            info_GC.XH = strXHGC;
            info_GC.PPXH = strPPGC + strXHGC;
            info_GC.ZCZWZ = strZCZWZGC;
            info_GC.CCDJRQ = strCCDJRQGC;
            info_GC.CCRQ = strCCRQGC;
            info_GC.CSYS = drpCSYSGC.SelectedItem.Text;
            info_GC.CSYSDH = drpCSYSGC.SelectedValue;
            info_GC.ZBZL = strZBZLGC;
            info_GC.ZZL = strZZLGC;
            info_GC.SYR = strSYRGC;
            info_GC.LXDZ = strAddressGC;
            info_GC.SYXZ = drpSYXZGC.SelectedItem.Text;
            info_GC.SYXZDH = drpSYXZGC.SelectedItem.Value;
            info_GC.HDZH = strHDZZLGC;
            //info_GC.JYXM_LW = strJYXMGC;
            info_GC.JYXM = strJYXMGC;
            info_GC.CSC = strCSCGC;
            info_GC.CSK = strCSKGC;
            info_GC.CSG = strCSGGC;
            info_GC.DLY = userInfo.UserName;
            info_GC.LWCXWZJLDH = drpLWCXWZJLGC.SelectedItem.Value;
            info_GC.LWCXWZJL = drpLWCXWZJLGC.SelectedItem.Text;
            info_GC.ZZS = drpZZSGC.SelectedItem.Value;
            info_GC.GLCHPHM = strHPHM;
            info_GC.GLCHPZL = drpHPZL.SelectedItem.Text;
            info_GC.GLCHPZLDH = drpHPZL.SelectedItem.Value;
            info_GC.GLCJYXM = strJYXM;

            //综检
            info_GC.YYZH = strYYZHGC;
            info_GC.XZQY = strXZQYGC;
            info_GC.BZZXS = drpBZZXSGC.SelectedItem.Text;
            info_GC.BZZXSDH = drpBZZXSGC.SelectedItem.Value;
            info_GC.HCCSXS = drpHCCSXSGC.SelectedItem.Value;
            info_GC.CLCCLX = drpCLCCLXGC.SelectedItem.Text;
            info_GC.CLCCLXDH = drpCLCCLXGC.SelectedItem.Value;
            info_GC.ZJCLLX = drpZJCLLXGC.SelectedItem.Text;
            info_GC.ZJCLLXDH = drpZJCLLXGC.SelectedItem.Value;

            LOGIN_VEHICLE_INFO_BLL bll = new LOGIN_VEHICLE_INFO_BLL();
            var vRet_Login_ZC = LoginHelper.GetLoginInfo(strHPHM, strHPZL);
            var vRet_Login_GC = LoginHelper.GetLoginInfo(strHPHMGC, strHPZLGC);

            DbFactory factory = new DbFactory();

            if (vRet_Login_ZC != null)
            {
                factory.Add(bll.UpdateSQL(info_ZC, vRet_Login_ZC.ID));
            }
            else
            {
                factory.Add(bll.InsertSQL(info_ZC));
            }

            if (vRet_Login_GC != null)
            {
                factory.Add(bll.UpdateSQL(info_GC, vRet_Login_GC.ID));
            }
            else
            {
                factory.Add(bll.InsertSQL(info_GC));
            }

            if (string.IsNullOrEmpty(userInfo.UserName))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "当前没有授权,请退出系统重新登录！");
                return;
            }

            bool bOnGoing = LoginHelper.GetVehicleStatus(strVEHICLEID);
            if (bOnGoing)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车辆【" + strVEHICLEID + "】正在检测，不能保存当前信息！");
                return;
            }

            bOnGoing = LoginHelper.GetVehicleStatus(strVEHICLEIDGC);
            if (bOnGoing)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车辆【" + strVEHICLEIDGC + "】正在检测，不能保存当前信息！");
                return;
            }

            bool bRet = factory.Execute();
            if (bRet)
            {
                hidID.Value = LoginHelper.GetLoginInfo(strHPHM, strHPZL).ID.ToString();
                hidGCID.Value = LoginHelper.GetLoginInfo(strHPHMGC, strHPZLGC).ID.ToString();
                LoginHelper.SavePPXHAndFDJXH(info_ZC);
                LoginHelper.SavePPXHAndFDJXH(info_GC);
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "," + strHPHMGC + "】保存成功！");
                btnSendGC.Enabled = true;
                btnSendGC.CssClass = "btnSendEnabled";
            }
            else
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "," + strHPHMGC + "】保存失败！");
                return;
            }
        }

        protected void btnSendGC_Click(object sender, EventArgs e)
        {
            var dicCheckItems = LoginHelper.CheckAllInputItems(hidID.Value, hidGCID.Value, "Z");
            if (dicCheckItems["Z"].Count > 0)
            {
                foreach (var v in dicCheckItems["Z"])
                {
                    TextBox txt = (TextBox)this.FindControl(v);
                    txt.BackColor = Color.Yellow;
                }
                return;
            }

            if (dicCheckItems["ZG"].Count > 0)
            {
                foreach (var v in dicCheckItems["ZG"])
                {
                    TextBox txt = (TextBox)this.FindControl(v);
                    txt.BackColor = Color.Yellow;
                }
                return;
            }

            LOGIN_VEHICLE_INFO_BLL info_bll = new LOGIN_VEHICLE_INFO_BLL();
            var info = info_bll.GetModel(Convert.ToInt32(hidID.Value));
            var infoGC = info_bll.GetModel(Convert.ToInt32(hidGCID.Value));
            if (string.IsNullOrEmpty(info.JYXM))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请选择主车检验项目保存后，在进行发送！");
                return;
            }

            if (string.IsNullOrEmpty(infoGC.JYXM))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请选择检验挂车项目保存后，在进行发送！");
                return;
            }

            bool bIsFirstTest_ZC = rbtnTest.SelectedValue == "0" ? true : false;//是否为初检
            bool bIsUpdate_ZC;
            VEHICLE_DISPATCH model_ZC = LoginHelper.GetDispathchByLoginID(hidID.Value, "Z", bIsFirstTest_ZC, out bIsUpdate_ZC);

            bool bIsFirstTest_GC = rbtnTestGC.SelectedValue == "0" ? true : false;//是否为初检
            bool bIsUpdate_GC;
            VEHICLE_DISPATCH model_GC = LoginHelper.GetDispathchByLoginID(hidGCID.Value, "Z", bIsFirstTest_GC, out bIsUpdate_GC);

            model_ZC.GLCJCLSH = model_GC.JCLSH;
            model_ZC.GLCHPHM = model_GC.HPHM;
            model_ZC.GLCHPZL = model_GC.HPZL;
            model_ZC.GLCHPZLDH = model_GC.HPZLDH;
            model_ZC.GLCJYXM = model_GC.JYXM;
            model_ZC.SFSQCLC = "1";

            model_GC.GLCJCLSH = model_ZC.JCLSH;
            model_GC.GLCHPHM = model_ZC.HPHM;
            model_GC.GLCHPZL = model_ZC.HPZL;
            model_GC.GLCHPZLDH = model_ZC.HPZLDH;
            model_GC.GLCJYXM = model_ZC.JYXM;
            model_GC.SFSQCLC = "1";

            VEHICLE_DISPATCH_BLL disBll = new VEHICLE_DISPATCH_BLL();

            DbFactory factory = new DbFactory();

            if (bIsUpdate_ZC)
            {
                factory.Add(disBll.UpdateSQL(model_ZC, model_ZC.JCLSH));
            }
            else
            {
                factory.Add(disBll.InsertSQL(model_ZC));
            }
            if (bIsUpdate_GC)
            {
                factory.Add(disBll.UpdateSQL(model_GC, model_GC.JCLSH));
            }
            else
            {
                factory.Add(disBll.InsertSQL(model_GC));
            }

            if (factory.Execute())
            {
                gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送成功！");
                ResetAllGC();
                btnSendGC.CssClass = "btnSendDisabled";
                btnSendGC.Enabled = false;
                LoginedList1.BindList("", "");
                return;
            }
            else
            {
                gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送失败！");
                btnSendGC.CssClass = "btnSendEnabled";
                btnSendGC.Enabled = true;
                return;
            }
        }

        private void ResetAllGC()
        {
            ResetAll();
            List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
            List<Control> lstControls = new List<Control>();

            lstCtl.Add(new LoginHelper.ControlNames(drpJYLBGC.ID, "12"));
            lstControls.Add(drpJYLBGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtZJLSHGC.ID, ""));
            lstControls.Add(txtZJLSHGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtHPHMGC.ID, ConfigurationManager.AppSettings["app_HPHM"]));
            lstControls.Add(txtHPHMGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpHPZLGC.ID, ""));
            lstControls.Add(drpHPZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(chkZCZWZGC.ID, "2,"));
            lstControls.Add(chkZCZWZGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtVINGC.ID, ""));
            lstControls.Add(txtVINGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLZLGC.ID, ""));
            lstControls.Add(drpCLZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtSYRGC.ID, ""));
            lstControls.Add(txtSYRGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtAddressGC.ID, ""));
            lstControls.Add(txtAddressGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpSYXZGC.ID, ""));
            lstControls.Add(drpSYXZGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtPPGC.ID, ""));
            lstControls.Add(txtPPGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtXHGC.ID, ""));
            lstControls.Add(txtXHGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpCSYSGC.ID, ""));
            lstControls.Add(drpCSYSGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCCRQGC.ID, DateTime.Now.AddYears(-5).ToString("yyyy-MM-dd")));
            lstControls.Add(txtCCRQGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSDJRQGC.ID, DateTime.Now.AddYears(-5).ToString("yyyy-MM-dd")));
            lstControls.Add(txtCSDJRQGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtZZLGC.ID, ""));
            lstControls.Add(txtZZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtZBZLGC.ID, ""));
            lstControls.Add(txtZBZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtHDZZLGC.ID, ""));
            lstControls.Add(txtHDZZLGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSCGC.ID, ""));
            lstControls.Add(txtCSCGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSKGC.ID, ""));
            lstControls.Add(txtCSKGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtCSGGC.ID, ""));
            lstControls.Add(txtCSGGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtXZQYGC.ID, ""));
            lstControls.Add(txtXZQYGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpZJCLLXGC.ID, ""));
            lstControls.Add(drpZJCLLXGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpLWCXWZJLGC.ID, ""));
            lstControls.Add(drpLWCXWZJLGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpHCCSXSGC.ID, ""));
            lstControls.Add(drpHCCSXSGC);

            lstCtl.Add(new LoginHelper.ControlNames(txtYYZHGC.ID, ""));
            lstControls.Add(txtYYZHGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLCCLXGC.ID, ""));
            lstControls.Add(drpCLCCLXGC);

            lstCtl.Add(new LoginHelper.ControlNames(drpBZZXSGC.ID, ""));
            lstControls.Add(drpBZZXSGC);

            lstCtl.Add(new LoginHelper.ControlNames(rbtnTestGC.ID, ""));
            lstControls.Add(rbtnTestGC);

            lstCtl.Add(new LoginHelper.ControlNames(chkJYXMGC.ID, ""));
            lstControls.Add(chkJYXMGC);

            foreach (var v in lstItemsGC)
            {
                v.Selected = false;
            }

            hidGCID.Value = "";

            LoginHelper.ResetAllControls(lstCtl, lstControls);
            drpZZSGC_SelectedIndexChanged(null, null);
            btnSaveGC.Enabled = true;
            btnSaveGC.CssClass = "btnSaveEnabled";
        }

        protected void btnResetGC_Click(object sender, EventArgs e)
        {
            ResetAllGC();
        }

        protected void chkAllGC_CheckedChanged(object sender, EventArgs e)
        {
            LoginHelper.CheckAll(chkJYXMGC, chkAllGC.Checked);
        }

        protected void lbtnCLZL_K_Click(object sender, EventArgs e)
        {
            string[] strKC = new string[] { "01", "K11", "Y12", "", "1", "1", "202", "B", "3", "0", "0", "1", "2", "2" };
            try
            {
                GetDefalutByCLLX(strKC);
            }
            catch (Exception ex)
            { }
        }

        protected void lbtnCLZL_H_Click(object sender, EventArgs e)
        {
            //货车
            string[] strHC = new string[] { "01", "H11", "Y18", "", "1", "1", "202", "B", "0", "1", "0", "0", "3", "2" };
            try
            {
                GetDefalutByCLLX(strHC);
            }
            catch (Exception ex)
            { }
        }

        protected void btnSearchFDJXH_Click(object sender, EventArgs e)
        {
            string strFDJXH = txtFDJXH.Text.Trim().ToUpper();

            TYPE_FDJ_CONTENT_BLL bll = new TYPE_FDJ_CONTENT_BLL();
            TYPE_FDJ_CONTENT[] m_TYPE_FDJ_CONTENT = bll.GetModelList("FDJXH='" + strFDJXH + "' order by ID desc");

            if (m_TYPE_FDJ_CONTENT.Length > 0)
            {
                TYPE_FDJ_CONTENT vContent = m_TYPE_FDJ_CONTENT[0];

                List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
                List<Control> lstControls = new List<Control>();

                lstCtl.Add(new LoginHelper.ControlNames(drpRLLB.ID, "RLLB"));
                lstControls.Add(drpRLLB);

                lstCtl.Add(new LoginHelper.ControlNames(txtEDGL.ID, "EDGL"));
                lstControls.Add(txtEDGL);

                if (txtEDGL.Enabled)
                {
                    lstCtl.Add(new LoginHelper.ControlNames(txtEDNJ.ID, "EDNJ"));
                    lstControls.Add(txtEDNJ);
                }

                if (txtEDNJZS.Enabled)
                {
                    lstCtl.Add(new LoginHelper.ControlNames(txtEDNJZS.ID, "EDNJZS"));
                    lstControls.Add(txtEDNJZS);
                }

                LoginHelper.GetFDJXH(vContent, lstCtl, lstControls);
            }
        }

        protected void btnSearchGCPPXH_Click(object sender, EventArgs e)
        {
            string strPPGC = txtPPGC.Text.Trim();
            string strXHGC = txtXHGC.Text.Trim().ToUpper();
            TYPE_CX_CONTENT_BLL bll = new TYPE_CX_CONTENT_BLL();
            TYPE_CX_CONTENT[] m_TYPE_CX_CONTENT = bll.GetModelList("PP='" + strPPGC + "' and XH='" + strXHGC + "' order by ID desc");

            if (m_TYPE_CX_CONTENT.Length > 0)
            {
                TYPE_CX_CONTENT vContent = m_TYPE_CX_CONTENT[0];

                if (!string.IsNullOrEmpty(vContent.ZZS))
                {
                    drpZZSGC.SelectedValue = vContent.ZZS;
                    drpZZSGC_SelectedIndexChanged(null, null);
                }

                List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
                List<Control> lstControls = new List<Control>();

                lstCtl.Add(new LoginHelper.ControlNames(chkZCZWZGC.ID.ToString(), "ZCZWZ"));
                lstControls.Add(chkZCZWZGC);

                lstCtl.Add(new LoginHelper.ControlNames(drpCLZLGC.ID.ToString(), "CLZL"));
                lstControls.Add(drpCLZLGC);

                lstCtl.Add(new LoginHelper.ControlNames(txtZZLGC.ID.ToString(), "ZZL"));
                lstControls.Add(txtZZLGC);

                lstCtl.Add(new LoginHelper.ControlNames(txtZBZLGC.ID.ToString(), "ZBZL"));
                lstControls.Add(txtZBZLGC);

                lstCtl.Add(new LoginHelper.ControlNames(txtHDZZLGC.ID.ToString(), "HDZH"));
                lstControls.Add(txtHDZZLGC);

                lstCtl.Add(new LoginHelper.ControlNames(txtCSCGC.ID.ToString(), "CSC"));
                lstControls.Add(txtCSCGC);

                lstCtl.Add(new LoginHelper.ControlNames(txtCSKGC.ID.ToString(), "CSK"));
                lstControls.Add(txtCSKGC);

                lstCtl.Add(new LoginHelper.ControlNames(txtCSGGC.ID.ToString(), "CSG"));
                lstControls.Add(txtCSGGC);

                LoginHelper.GetPPXH(vContent, lstCtl, lstControls);
            }
        }

        protected void drpCLZL_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (drpCLZL.SelectedValue.Substring(0, 1) == "K")
            {
 
            }
            else if (drpCLZL.SelectedValue.Substring(0, 1) == "H")
            {
                drpKCLXDJ.SelectedValue = "-";
                drpKCLXDJ.Enabled = false;
            }
        }

        protected void lbtnLoginedShow_Click(object sender, EventArgs e)
        {
            if (divLoginList.Visible == false)
            {
                lbtnLoginedShow.Text = "收 起︽";
                divLoginList.Visible = true;
            }
            else
            {
                lbtnLoginedShow.Text = "展 开︾";
                divLoginList.Visible = false;
            }
        }

        protected void rblSelectItems_SelectedIndexChanged(object sender, EventArgs e)
        {
            LoginHelper.BindTemplate("Z", rblSelectItems, chkJYXM, lstItems);
        }

        protected void rblCheckItemGC_SelectedIndexChanged(object sender, EventArgs e)
        {
            LoginHelper.BindTemplate("ZG", rblSelectItems, chkJYXMGC, lstItems);
        }

        protected void drpRLLB_SelectedIndexChanged(object sender, EventArgs e)
        {
            string strRLLB = drpRLLB.SelectedValue;
            if (strRLLB == "A" || strRLLB == "E" || strRLLB == "O")
            {
                txtEDGL.Enabled = false;
                txtEDNJ.Enabled = true;
                txtEDNJZS.Enabled = true;
                txtYDXZ.Enabled = false;
                lblYDXZStar.Visible = false;
                lblEDGLStar.Text = "";
                lblStarNJZS.Text = "*";
                lblStarNJ.Text = "*";
            }
            else if (strRLLB == "B" || strRLLB == "D" || strRLLB == "F")
            {
                txtEDGL.Enabled = true;
                txtEDNJ.Enabled = false;
                txtEDNJZS.Enabled = false;
                txtYDXZ.Enabled = true;
                lblYDXZStar.Visible = true;
                lblEDGLStar.Text = "*";
                lblStarNJZS.Text = "";
                lblStarNJ.Text = "";
            }
        }

        protected void lbtnCLZL_X_Click(object sender, EventArgs e)
        {
            //HPZL,CLZL,SYXZ,SYR ZXZLX,ZXZXJSX,QDXS,RLLB,KCLXDJ,HCCSXS,BZZXS,ZJCLLX,ClCCLX,SFSWPC
            //小型车
            string[] strXX = new string[] { "02", "K43","Y12","", "1", "0", "201","A", "0","0","0","2","1","2"};
            try
            {
                GetDefalutByCLLX(strXX);
            }
            catch (Exception ex)
            {
 
            }
        }

        private void GetDefalutByCLLX(string[] strLst)
        {
            List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
            List<Control> lstControls = new List<Control>();

            lstCtl.Add(new LoginHelper.ControlNames(drpHPZL.ID, strLst[0]));
            lstControls.Add(drpHPZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLZL.ID, strLst[1]));
            lstControls.Add(drpCLZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpSYXZ.ID, strLst[2]));
            lstControls.Add(drpSYXZ);

            lstCtl.Add(new LoginHelper.ControlNames(txtSYR.ID, strLst[3]));
            lstControls.Add(txtSYR);

            lstCtl.Add(new LoginHelper.ControlNames(drpZXZLX.ID, strLst[4]));
            lstControls.Add(drpZXZLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpZXZXJXS.ID, strLst[5]));
            lstControls.Add(drpZXZXJXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpQDXS.ID, strLst[6]));
            lstControls.Add(drpQDXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpRLLB.ID, strLst[7]));
            lstControls.Add(drpRLLB);

            lstCtl.Add(new LoginHelper.ControlNames(drpKCLXDJ.ID, strLst[8]));
            lstControls.Add(drpKCLXDJ);

            lstCtl.Add(new LoginHelper.ControlNames(drpHCCSXS.ID, strLst[9]));
            lstControls.Add(drpHCCSXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpBZZXS.ID, strLst[10]));
            lstControls.Add(drpBZZXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpZJCLLX.ID, strLst[11]));
            lstControls.Add(drpZJCLLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLCCLX.ID, strLst[12]));
            lstControls.Add(drpCLCCLX);

            lstCtl.Add(new LoginHelper.ControlNames(drpSFSWPC.ID, strLst[13]));
            lstControls.Add(drpSFSWPC);

            LoginHelper.ResetAllControls(lstCtl, lstControls);

            drpRLLB_SelectedIndexChanged(null, null);
        }

        protected void lbtnCLZL_Q_Click(object sender, EventArgs e)
        {
            //牵引车
            string[] strQYC = new string[] { "01", "Q11", "Y18", "", "1", "1", "202", "B", "0", "3", "1", "0", "3", "2" };
            try
            {
                GetDefalutByCLLX(strQYC);
            }
            catch (Exception ex)
            {

            }
        }

        /// <summary>
        /// 保存前检查所有textbox填入的是否合理
        /// </summary>
        /// <returns></returns>
        private bool CheckAllTextBox()
        {
            //综检检验登录
            string strJYLB = drpJYLB.SelectedValue.Trim() + ",";
            string strHPHM = txtHPHMStart.Text.Trim().ToUpper() + txtHPHM.Text.Trim().ToUpper();
            string strHPHM_H = txtHPHMStart.Text.Trim().ToUpper();
            string strHPHM_C = txtHPHM.Text.Trim().ToUpper();
            string strHPZL = drpHPZL.SelectedValue.Trim();
            string strVIN = txtVIN.Text.Trim().ToUpper();
            string strSYR = txtSYR.Text.Trim();
            string strAddress = txtAddress.Text.Trim();
            string strPP = txtPP.Text.Trim();
            string strXH = txtXH.Text.Trim().ToUpper();
            string strFDJXH = txtFDJXH.Text.Trim().ToUpper();
            string strFDJHM = txtFDJNumber.Text.Trim().ToUpper();
            string strCCRQ = txtCCRQ.Text.Trim();
            string strCSDJRQ = txtCSDJRQ.Text.Trim();
            string strHZRS = txtHZRS.Text.Trim();
            string strZZL = txtZZL.Text.Trim();
            string strZBZL = txtZBZL.Text.Trim();
            string strHDZZL = txtHDZZL.Text.Trim();
            string strWKCCC = txtWKCCC.Text.Trim();
            string strWKCCK = txtWKCCK.Text.Trim();
            string strWKCCG = txtWKCCG.Text.Trim();
            string strZCZWZ = "";
            string strQDZWZ = "";
            string strZGSJCS = txtZGSJCS.Text.Trim();
            string strEDGL = txtEDGL.Text.Trim();
            string strEDNJ = txtEDNJ.Text.Trim();
            string strEDNJZS = txtEDNJZS.Text.Trim();
            string strYZLJ = txtYZLJ.Text.Trim();
            string strQDZKZZL = txtQDZKZZL.Text.Trim();
            string strHDZH = txtHDZH.Text.Trim();
            string strLJXSLC = txtLJXSLC.Text.Trim();
            string strYYZH = txtYYZH.Text.Trim();
            string strXZQY = txtXZQY.Text.Trim();

            string strYHXZ = txtYHXZ.Text.Trim();
            string strYHSD = txtYHSD.Text.Trim();
            string strYDXZ = txtYDXZ.Text.Trim();
            string strPL = txtPL.Text.Trim();
            string strEDZS = txtEDZS.Text.Trim();

            if (string.IsNullOrEmpty(strHPHM_H))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "号牌号码开头不能为空！");
                txtHPHMStart.Focus();
                txtHPHMStart.BackColor = Color.Yellow;
                return false;
            }
            else
            {
                txtHPHMStart.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strHPHM_C))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "号牌号码不能为空！");
                txtHPHM.Focus();
                txtHPHM.BackColor = Color.Yellow;
                return false;
            }
            else
            {
                txtHPHM.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strCCRQ) == false)
            {
                if (gfValidate.Is_DateTime(strCCRQ) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "出厂日期不是日期格式！");
                    txtCCRQ.BackColor = Color.Yellow;
                    return false;
                }
                else
                {
                    txtCCRQ.BackColor = Color.White;
                }
            }
            else
            {
                txtCCRQ.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strCSDJRQ) == false)
            {
                if (gfValidate.Is_DateTime(strCSDJRQ) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "初始登记日期不是日期格式！");
                    txtCSDJRQ.Focus();
                    txtCSDJRQ.BackColor = Color.Yellow;
                    return false;
                }
                else
                {
                    txtCSDJRQ.BackColor = Color.White;
                }
            }

            if (string.IsNullOrEmpty(strHZRS) == false)
            {
                if (gfValidate.Is_Integer(strHZRS) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "核载人数不是整数！");
                    txtHZRS.Focus();
                    txtHZRS.BackColor = Color.Yellow;
                    return false;
                }
                else
                {
                    txtHZRS.BackColor = Color.White;
                }
            }
            else
            {
                txtHZRS.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strPL) == false)
            {
                if (gfValidate.Is_Integer(strPL) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "排量不是整数！");
                    txtPL.Focus();
                    txtPL.BackColor = Color.Yellow;
                    return false;
                }
                else
                {
                    txtPL.BackColor = Color.White;
                }
            }
            else
            {
                txtPL.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strEDZS) == false)
            {
                if (gfValidate.Is_Integer(strEDZS) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "额定转速不是整数！");
                    txtEDZS.Focus();
                    txtEDZS.BackColor = Color.Yellow;
                    return false;
                }
                else
                {
                    txtEDZS.BackColor = Color.White;
                }
            }
            else
            {
                txtEDZS.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strZZL) == false)
            {
                if (gfValidate.Is_Integer(strZZL) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "总质量不是整数！");
                    txtZZL.Focus();
                    txtZZL.BackColor = Color.Yellow;
                    return false;
                }
                else
                {
                    txtZZL.BackColor = Color.White;
                }
            }
            else
            {
                txtZZL.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strZBZL) == false)
            {
                if (gfValidate.Is_Integer(strZBZL) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "整备质量不是整数！");
                    txtZBZL.Focus();
                    txtZBZL.BackColor = Color.Yellow;
                    return false;
                }
            }
            else
            {
                txtZBZL.BackColor = Color.White;
            }

            if (!string.IsNullOrEmpty(strHDZZL) && !gfValidate.Is_Integer(strHDZZL))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "核定载质量不是整数！");
                txtHDZZL.Focus();
                txtHDZZL.BackColor = Color.Yellow;
                return false;
            }
            else
            {
                txtHDZZL.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strWKCCC) == false && !gfValidate.Is_Integer(strWKCCC))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "外廓尺寸长不是整数！");
                txtWKCCC.Focus();
                txtWKCCC.BackColor = Color.Yellow;
                return false;
            }
            else
            {
                txtWKCCC.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strWKCCC) == false && !gfValidate.Is_Integer(strWKCCC))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "外廓尺寸长不是整数！");
                txtWKCCC.Focus();
                txtWKCCC.BackColor = Color.Yellow;
                return false;
            }
            else
            {
                txtWKCCC.BackColor = Color.White;
            }

            //驱动轴位置
            for (int i = 0; i < chkQDZWZ.Items.Count; i++)
            {
                if (chkQDZWZ.Items[i].Selected)
                {
                    strQDZWZ += chkQDZWZ.Items[i].Value + ",";
                }
            }

            if (string.IsNullOrEmpty(strZGSJCS) == false && !gfValidate.Is_Integer(strZGSJCS))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "最高设计车速不能为空！");
                txtZGSJCS.Focus();
                txtZGSJCS.BackColor = Color.Yellow;
                return false;
            }
            else
            {
                txtZGSJCS.BackColor = Color.White;
            }

            if (drpRLLB.SelectedValue == "B" || drpRLLB.SelectedValue == "D" || drpRLLB.SelectedValue == "F" || drpRLLB.SelectedValue == "L")
            {//柴油 额定功率不能为空
                if (string.IsNullOrEmpty(strEDGL) == false)
                {
                    if (!gfLibrary.gfValidate.Is_Float(strEDGL))
                    {
                        gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "额定功率不是有效的数字格式！");
                        txtEDGL.Focus();
                        txtEDGL.BackColor = Color.Yellow;
                        return false;
                    }
                    else
                    {
                        txtEDGL.BackColor = Color.White;
                    }
                }

                if (string.IsNullOrEmpty(strYDXZ) == false && divYHYD.Visible)
                {
                    if (!gfLibrary.gfValidate.Is_Float(strYDXZ))
                    {
                        gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "[不透光限制]不是有效的数字格式！");
                        txtYDXZ.Focus();
                        txtYDXZ.BackColor = Color.Yellow;
                        return false;
                    }
                }
                else
                {
                    txtYDXZ.BackColor = Color.White;
                }
            }

            if (drpRLLB.SelectedValue == "A" || drpRLLB.SelectedValue == "E" || drpRLLB.SelectedValue == "O")
            {
                if (string.IsNullOrEmpty(strEDNJ) == false)
                {
                    if (!gfLibrary.gfValidate.Is_Integer(strEDNJ))
                    {
                        gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "[额定扭矩]不是有效的数字格式！");
                        txtEDNJ.Focus();
                        txtEDNJ.BackColor = Color.Yellow;
                        return false;
                    }
                }
                else
                {
                    txtEDNJ.BackColor = Color.White;
                }

                if (string.IsNullOrEmpty(strEDNJZS) == false)
                {
                    if (!gfLibrary.gfValidate.Is_Integer(strEDNJZS))
                    {
                        gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "[额定扭矩转速]不是有效的数字格式！");
                        txtEDNJZS.Focus();
                        txtEDNJZS.BackColor = Color.Yellow;
                        return false;
                    }
                }
                else
                {
                    txtEDNJZS.BackColor = Color.White;
                }
            }

            if (string.IsNullOrEmpty(strYZLJ) == false)
            {
                if (!gfLibrary.gfValidate.Is_Integer(strYZLJ))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "[前轮距]不是有效的数字格式！");
                    txtYZLJ.Focus();
                    txtYZLJ.BackColor = Color.Yellow;
                    return false;
                }
            }
            else
            {
                txtYZLJ.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strQDZKZZL) == false)
            {
                if (!gfLibrary.gfValidate.Is_Float(strQDZKZZL))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "[驱动轴空载质量]不是有效的数字格式！");
                    txtQDZKZZL.Focus();
                    txtQDZKZZL.BackColor = Color.Yellow;
                    return false;
                }
            }
            else
            {
                txtQDZKZZL.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strHDZH) == false)
            {
                if (!gfLibrary.gfValidate.Is_Float(strHDZH))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "[牵引车满载总质量]不是有效的数字格式！");
                    txtHDZH.Focus();
                    txtHDZH.BackColor = Color.Yellow;
                    return false;
                }
            }
            else
            {
                txtHDZH.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strLJXSLC) == false)
            {
                if (!gfLibrary.gfValidate.Is_Float(strLJXSLC))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "[累计行驶里程]不是有效的数字格式！");
                    txtLJXSLC.Focus();
                    txtLJXSLC.BackColor = Color.Yellow;
                    return false;
                }
                else
                {
                    txtLJXSLC.BackColor = Color.White;
                }
            }

            for (int i = 0; i < chkZCZWZ.Items.Count; i++)
            {
                if (chkZCZWZ.Items[i].Selected)
                {
                    strZCZWZ += chkZCZWZ.Items[i].Value + ",";
                }
            }

            if (string.IsNullOrEmpty(strZCZWZ))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请选择驻车轴位置！");
                return false;
            }

            for (int i = 0; i < chkQDZWZ.Items.Count; i++)
            {
                if (chkQDZWZ.Items[i].Selected)
                {
                    strQDZWZ += chkQDZWZ.Items[i].Value + ",";
                }
            }

            if (string.IsNullOrEmpty(strQDZWZ))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请选择驱动轴轴位置！");
                return false;
            }

            return true;
        }
    }
}